yaqub Posted August 3, 2006 Share Posted August 3, 2006 Hi-I'm trying to make a simple mail form using dreamweaver and when I preview the page I get this error:::Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\newland\message_sent.php on line 6I'm not sure what to do here. I want to make sure that I'm headed in the right direction so can someone please let me know how or what I can change to make this work.Also here's the dreamweaver code::<?php$to = "[email protected]";$subject = "This is the message subject";$body = "This is the message body";$headers = "From: [email protected]\n";mail($to,$subject,$body,$headers);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Newland Tours: About</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><link href="css/newland.css" rel="stylesheet" type="text/css" /></head><body><a href="#top"><img src="images/spacer.gif" alt="Skip to main image" width="1" height="1" border="0" align="left" /></a><table width="750" border="0" cellpadding="3" cellspacing="0"> <tr> <td><img src="images/banner_left.gif" alt="Newland Tours Banner" width="451" height="68" /></td> <td width="280"><img src="images/banner_right.jpg" alt="Newland Tours Banner, previous tour images" width="276" height="68" /></td> </tr> <tr> <td><img src="images/navbar.gif" name="navbar" alt="Newland Tours image" width="450" height="20" border="0" usemap="#navbarMap" /></td> <td><img name="copyright_bar" src="images/copyright_bar.gif" alt="Copyright 2006 Newland Tours width="272" height="20" border="0" /></td> </tr> <tr> <td colspan="2"> <h1><br /> <a name="top" id="top"></a>Message Sent </h1> <p>Your message has been sent. We will contact you soon.</p> <p>Return to Newland <a href="index.php">home</a>. </p></td> </tr></table><br /><br /><map name="navbarMap" id="navbarMap"> <area shape="rect" coords="1,0,62,20" href="index.php" alt="Home" /> <area shape="rect" coords="71,0,117,20" href="about.php" alt="About" /> <area shape="rect" coords="129,0,196,20" href="tours.php" alt="Find Tours" /> <area shape="rect" coords="209,0,311,20" href="profiles.php" alt="Navigation Bar" /> <area shape="rect" coords="327,0,434,20" href="contact.php" alt="Contact An Agent" /></map></body></html>Please give me a hand with this, it's much appreciated.Ya'qub :D Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/ Share on other sites More sharing options...
scottybwoy Posted August 3, 2006 Share Posted August 3, 2006 Are you actually using a mail server on your local host. Also check your php.ini file to check if your using the right SMTP settings Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-68373 Share on other sites More sharing options...
yaqub Posted August 3, 2006 Author Share Posted August 3, 2006 I'm new. So I'm using Apache and I have looked at the php.ini file I think. Can someone give me some step by step advice instaed of just saying have you done this or that? I'm new so for me to mess with the .ini file I would need some type of assistance. Thanks Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-68805 Share on other sites More sharing options...
yaqub Posted August 4, 2006 Author Share Posted August 4, 2006 How do I check the SMTP settings and how do I change them? I'm using QK SMTp server I hope someone can please walk me through this step by step.I'm having a really hard time trying to find help which is really surprising, I thought that people formed a rather tight community to help newbies get up and started.Please anyone who's ever had this problem please walk me through what I got to do here. I know this is a common problem so everyone has gone through at one point in time.Thanks Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69030 Share on other sites More sharing options...
tomfmason Posted August 4, 2006 Share Posted August 4, 2006 are you referring to the settings in the php.ini? Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69031 Share on other sites More sharing options...
yaqub Posted August 4, 2006 Author Share Posted August 4, 2006 I think this is where I have to specify what server I'm using isn't it? From the error message it says that it's unable to find a mail server.You tell me, I think it's basically saying I have reconfig the php.ini file to reflect what mail server I'm using. But I'm having trouble finding it(I installed apache to the default location so you should know exactly where that file is). I downloaded and installed QK SMTP mail server which is running also Apache is running obviously by the error message.So do you have some ideas for me? I know this is a commone problem especially for newbies.Thanks Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69040 Share on other sites More sharing options...
yaqub Posted August 4, 2006 Author Share Posted August 4, 2006 Wow. I'm surprised no one knows about this issue. I really thought people would maybe offer a little more help to a newbie php'erDisappointed Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69403 Share on other sites More sharing options...
ryanlwh Posted August 4, 2006 Share Posted August 4, 2006 is the smtp server on the same computer as the apache server? is it running correctly? if you want to test the server, you can send an email with MS Outlook or MS Exchange using that smtp server and make sure that it's working properly.you also want to see if windows firewall is configured correctly for the server and port 25. go to Control Panel->Windows Firewall->Exceptions. Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69406 Share on other sites More sharing options...
kenrbnsn Posted August 4, 2006 Share Posted August 4, 2006 Create a script with this line in it:[code]<?php phpinfo(); ?>[/code]and bring it up. In the output will be the location of the PHP.INI fileKen Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69407 Share on other sites More sharing options...
yaqub Posted August 4, 2006 Author Share Posted August 4, 2006 Thanks guys for the new tips Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-69442 Share on other sites More sharing options...
mrparanoid Posted October 11, 2006 Share Posted October 11, 2006 If the tips above does not help, have a look at pear mail function on php.net ;) Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-107643 Share on other sites More sharing options...
whitehat Posted October 11, 2006 Share Posted October 11, 2006 on windows look in C:\WINDOWS for the php.inifind:[mail function]; For Win32 only.SMTP = mail.yourhost.com <----use the mailserver from your isp; For Win32 only.sendmail_from = [email protected] <-- pick 1 of your emails that runs on the isp server; For Unix only. You may supply arguments as well (default: "sendmail -t -i").;sendmail_path =dont forget to reboot your apache... if not now how.. just reboot windows Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-107646 Share on other sites More sharing options...
heckenschutze Posted October 11, 2006 Share Posted October 11, 2006 you can also use ini set...<?phpini_set("sendmail_from", "[email protected]");ini_set("SMTP", "mail.yourhost.com");ini_set("smtp_port", 25);?> Link to comment https://forums.phpfreaks.com/topic/16416-im-new-with-php-can-someone-please-help-me-out-with-something/#findComment-107672 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.