spainsoccerfreak Posted January 28, 2009 Share Posted January 28, 2009 OK SO I have my html code and PHP code I tried the form I cant get it to send the info requested to my email I have only coded first 3 things I need from to form to get email but wont work I need help and get these message when hit the submit button **Thank You for your message! Your State is: texas Your district is:OP Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.mail.yahoo.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\xampp\sendmail1.php on line 27 Problem sending email. ******************** Here is the code that I have <code html> <html> <head> <title> E-mail Form </title> </head> <body> <form action="sendmail1.php" method= "POST"> <p>State:</p> <input type="text" size="25" name="state"> <p>School:</p> <input type="text" size="25" name="school"> <p>District:</p> <input type="text" size="25" name="district"> <p>Number of Concurrent Users:</p> <input type="text" size="10" name="number"> <p>System Servers</p> <input type="checkbox" name="system" value="2003" /> Microsoft Server 2003><br> <input type="checkbox" name="system" value="2007" />Microsoft Server 2007<br> <p>SQL Server</p> <input type="checkbox" name="server" value="2000" /> SQL Server 2000<br> <input type="checkbox" name="server" value="2005" />SQL Server 2005<br> <input type="checkbox" name="server" value="2008" />SQL Server 2008<br> <p>Network</p> <input type="checkbox" name="network" value="LAN" /> LAN<br> <input type="checkbox" name="network" value="WAN" />WAN<br> <p>Connection Type</p> <input type="checkbox" name="connection" value="T1" /> T1<br> <input type="checkbox" name="connection" value="fiber" />Fiber<br> <p>Recommended Server Specifications</p> <table border="1"> <tr> <td>Concurrent User</td> <td>CPU</td> <td>CPU Utilization</td> <td>RAM</td> <td>RAID Configuration</td> </tr> <tr> <td>10 or less</td> <td>Single CPU 1GHz Or Higher</td> <td>50%</td> <td>1 GB</td> <td>Standard SQL backup policies (No RAID required)</td> </tr> <tr> <td>11-25</td> <td>Dual CPU 1 GHz Or Higher</td> <td>30%</td> <td>2 GB</td> <td>RAID 1 disk mirroring</td> </tr> <tr> <td>26-50</td> <td>Dual CPU 2 GHz Or Higher</td> <td>25%</td> <td>2 GB</td> <td>RAID 5 (Recommended)</td> </tr> <tr> <td>50+</td> <td>Dual CPU 2 GHz Or Higher</td> <td>Dedicated Server (Recommended)</td> <td>2 GB</td> <td>RAID 5 (Recommended)</td> </tr> </table> <p>Personnel</p> <table border="1"> <tr> <td>Title, Name </td> <td><input type="text" size="30" name="name"></td> </tr> <tr> <td>Database Administrator, </td> <td><input type="text" size="30" name="dataadmin"></td> </tr> <tr> <td>Systems Administrator, </td> <td><input type="text" size="30" name="systemadmin"></td> </tr> <tr> <td>Program Administrator</td> <td><input type="text" size="30" name="programadmin"></td> </tr> </table> <p><input type="submit" value="Send" /></p> </form> </body> </html> <code> <PHP code> <html> <head> <title> Sending Email Form in listing </title> </head> <body> <?php $state = trim($_POST['state']); $school = trim($_POST['school']); $district = trim($_POST['district']); echo "<p>Thank You for your message!</p>\n"; echo "<p>Your State is: <b>$state</b></p>"; echo "<p>Your district is:<b>$district</b></p>"; //start building the mail string $msg = "State: $state\n"; $msg .= "School: $school\n"; $msg .= "District:$district\n"; //set up the mail $recipient = "myname@yahoo.com"; $subject = "Form Submition Results"; $mailheaders = "From: my site"; $mailheaders .= "Reply - To: " .$_POST["email"]; //send the mail mail if (mail($recipient, $subject, $msg, $mailheaders)) { echo "<br><br>Message sent."; } else { echo "<br><br>Problem sending email."; } ?> </body> </html> <code> My PHP.ini I have it configured like this [mail function] ; For Win32 only. SMTP = smtp.mail.yahoo.com smtp_port = 25 ; For Win32 only. ;sendmail_from = myname@yahoo.com Quote Link to comment https://forums.phpfreaks.com/topic/142820-php-form-info-send-to-yahoo-email-address/ Share on other sites More sharing options...
JonnoTheDev Posted January 28, 2009 Share Posted January 28, 2009 Because yahoo's mail server requires SMTP authentication. You cannot add this within the php.ini You will have to use PEAR::Mail http://pear.php.net/package/Mail Quote Link to comment https://forums.phpfreaks.com/topic/142820-php-form-info-send-to-yahoo-email-address/#findComment-748649 Share on other sites More sharing options...
spainsoccerfreak Posted January 28, 2009 Author Share Posted January 28, 2009 Ok I have mercury come with XAMPP will that work? or do I need PEAR ? Quote Link to comment https://forums.phpfreaks.com/topic/142820-php-form-info-send-to-yahoo-email-address/#findComment-748665 Share on other sites More sharing options...
PFMaBiSmAd Posted January 28, 2009 Share Posted January 28, 2009 It's port 465 anyway - http://help.yahoo.com/l/us/yahoo/mail/original/mailplus/pop/pop-14.html For the yahoo (or any other ISP's) mail server to accept an email over an Internet connection using SMTP, you must either appear as an email client using SMTP authentication or you must have a properly configured public mail server. For a php script appear as an email client using SMTP authentication, you must use one of the php mailer classes like PEAR::Mail or the phpmailer class. Most email servers can be setup up as email clients to other mail servers, where they provide SMTP authentication to the actual mail server. I don't know if Mercury mail supports this. To have a properly configured public mail server, you must have a mail server (which you have) and you must also have a domain name and a DNS server that has the necessary zone records that allow receiving mail servers to validate your sending mail server and determine that it is authorized to send email with the domain you are using in the From: address. Quote Link to comment https://forums.phpfreaks.com/topic/142820-php-form-info-send-to-yahoo-email-address/#findComment-748744 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.