fazlionline Posted June 7, 2009 Share Posted June 7, 2009 Hi allI cannot send email from a form to my inboxHTML code: <html><link href="school.css" rel="stylesheet" type="text/css"><body><table width="400" border="0" align="center" cellpadding="3" cellspacing="3"> <tr> <td><form id="form1" name="form1" method="post" action="email01.php"> <table width="400" border="1" cellpadding="7" cellspacing="3" bordercolor="#990000"> <tr> <td colspan="2" bgcolor="#FF9900"><h1>Send us your feed back:</h1></td> </tr> <tr> <td valign="top">Name:</td> <td><label> <input type="text" name="urname" id="urname" /> </label></td> </tr> <tr> <td valign="top">Email:</td> <td><label> <input type="text" name="uremail" id="uremail"> </label></td> </tr> <tr> <td valign="top">Message:</td> <td><label> <textarea name="urmessage" id="urmessage" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td colspan="2" align="center" valign="top"><label> <input type="submit" name="button" id="button" value="Send Your Message" /> </label></td> </tr> </table> </form> </td> </tr></table></body></html>And my PHP code is this:<?php$to = 'myemail@yahoo.com';$name = $_POST['urname'];$email = $_POST['uremail'];$message = $_POST['urmessage'];$headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();mail($to, $name, $email, $message, $headers);?>The error I get is:Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in E:\inetpub\vhosts\fazlionline.com\httpdocs\school\email01.php on line 10Is there anything missing in my code?Need help Link to comment Share on other sites More sharing options...
boen_robot Posted June 7, 2009 Share Posted June 7, 2009 In order to send email, PHP connects to an SMTP server. That SMTP server is the problem, as you can see by the error message. Your PHP is fine. Check your settings in php.ini, or if this is with a host, contact your host. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.