aafordy Posted August 27, 2009 Share Posted August 27, 2009 Hi, I have this php in use at linked from www.dpsconsultantsurveyors.co.uk/contact.html you press send and it goes through to Warning: mail() [function.mail]: SMTP server response: 554 <[email protected]>: Recipient address rejected: Relay access denied in E:\domains\d\dpsconsultantsurveyors.co.uk\user\htdocs\contactpage.php on line 141 We encountered an error sending your mail I have the following php in use and have not altered it: <?PHP $to = "[email protected]"; $subject = "dps enquiry"; $email = $_REQUEST['emailaddress'] ; $message = "First name: ".$_REQUEST['firstname'] ; $message .= "Surname: ".$_REQUEST['secondname'] ; $message .= "Phone number: ".$_REQUEST['phonenumber'] ; $message .= "Address: ".$_REQUEST['address'] ; $message .= "Address2: ".$_REQUEST['address2'] ; $message .= "Address3: ".$_REQUEST['address3'] ; $message .= "Address4: ".$_REQUEST['address4'] ; $message .= "Nature of enquiry: ".$_REQUEST['enquiry'] ; $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print ""; } else {print "We encountered an error sending your mail"; } ?> I've updated the css and rejigged the form a bit but have not touched the contactpage.php php itself? Any one now why this is happening? Thanks, Link to comment https://forums.phpfreaks.com/topic/172101-help-my-forms-stopped-working/ Share on other sites More sharing options...
JonnoTheDev Posted August 27, 2009 Share Posted August 27, 2009 Firstly your mail headers are incomplete. <?php $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain;\r\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: php\n"; $headers .= "From: \"".$_REQUEST['firstname']." ".$_REQUEST['secondname']."\" <".$email.">\n"; $headers .= "Reply-To: \"".$_REQUEST['firstname']." ".$_REQUEST['secondname']."\" <".$email.">\n"; ?> Warning: mail() [function.mail]: SMTP server response: 554 <[email protected]>: Recipient address rejected: Relay access denied Do you know what mail relaying is? Your SMTP mail server is rejecting the email because: 1. The mail server is not responsible for the sender or sending domain or for the recipient or receiving domain. 2. The details of the sender could not be verified. In other words your mail server does not manage this domain: dpsconsultantsurveyors.co.uk Restrictions may have been put in place on your mail server. If this is not your server then your should contact your hosting company. It is not a script issue. Link to comment https://forums.phpfreaks.com/topic/172101-help-my-forms-stopped-working/#findComment-907395 Share on other sites More sharing options...
aafordy Posted August 27, 2009 Author Share Posted August 27, 2009 Thanks for that, I thought it might be, its worked a couple of times then the errors come up since? must be something going on, Link to comment https://forums.phpfreaks.com/topic/172101-help-my-forms-stopped-working/#findComment-907422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.