TheUkSniper Posted February 17, 2011 Share Posted February 17, 2011 Hello, Been using the mail() function for some time now, but since I have moved to a new host, my mail is getting bouncebacks 550 (Email is detected as spam). Any ideas on why this may be if the script has not changed? Kind Regards, Alex Quote Link to comment https://forums.phpfreaks.com/topic/227987-php-mail/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 17, 2011 Share Posted February 17, 2011 The 550 error generally means that relaying is not permitted (despite what the actual 'text' part of the error states) and that you are not satisfying the relaying restrictions setup on your sending mail server. A) You should check what requirements your new host has concerning relaying (generally either the To: email address must be hosted on the sending mail server or the From: email address must be hosted on the sending mail server to satisfy relaying restrictions) and/or using SMTP authentication, B) For us to be able to help, we would need to know what requirements your host has and what your script is doing. Quote Link to comment https://forums.phpfreaks.com/topic/227987-php-mail/#findComment-1175630 Share on other sites More sharing options...
TheUkSniper Posted February 17, 2011 Author Share Posted February 17, 2011 Hello, The error I'm getting is coming from the remote mail client. Services like hotmail are recieving the mail but one company that I have to send emails too is not (even though it was before). This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [email protected] SMTP error from remote mail server after end of data: host mail.dcleisure.co.uk [195.224.182.114]: 550 This message is spam and is rejected. Code I am using is as follows; // subject $subject = 'iSwim Registration'; // message $message = ' <html> <head> <title>iSwim Registration</title> <style type="text/css"> <!-- body {font-family: Verdana, Arial, Helvetica, sans-serif} .style1 {font-weight: bold} .style2 {color: #0089CE} --> </style> </head> <body> <p align="left" class="style1"><img src="http://www.wolvesstaff.co.uk/iswim/images/iswimheader.png" width="536" height="124"></p> <h3 class="style2">Your registration to iSwim is now complete!</h3> <p>Your temporary password is: Blah</p> <p>Once you have logged in, you can change this password to something more memorable!<br> We look forward to seeing you online soon!</p> <p><span class="style1">iSwim Administration Team</span><br> </p> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset="iso-8859-1"' . "\r\n"; // Additional headers $headers .= 'To: [email protected], [email protected]' . "\r\n"; $headers .= 'From: iSwim Robot <[email protected]>' . "\r\n"; // Mail it $sendMail = @mail($to, $subject, $message, $headers); The headers with the To: email address obviously have been changed for testing purposes, this would usually be a variable set prior to the page being loaded. Kind Regards, Quote Link to comment https://forums.phpfreaks.com/topic/227987-php-mail/#findComment-1175640 Share on other sites More sharing options...
PFMaBiSmAd Posted February 18, 2011 Share Posted February 18, 2011 Doesn't the information in that message suggest to you that you should contact the administrator of that receiving mail server to find out why it considers the email that you sent to it to be spam? Best guess is, if this worked from your previous mail server to that specific receiving mail server, but not from your current mail server, it is likely due to missing or incorrect dns zone records (A, MX, SPF) for your sending mail server. Quote Link to comment https://forums.phpfreaks.com/topic/227987-php-mail/#findComment-1176131 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.