We aren't exactly pleased with our hosting company either and will possibly be transferring to a different company.
We know the emails are not sending because we have included our own emails in the mailing list as well as other people we know and have never received any of the emails.
We also started getting the error message 'No recipient addresses found in header', which has never been there before and we haven't altered any of our php code.
Any solutions I've found online for this error message so far aren't applicable as we've already had the recommended fixed code in place.
Yeah, I think you may need to seek a new host.
All I know for sure, is that the error you have is coming from sendmail. Why its that way I'm not 100% sure. The email would be the most probable cause.
If your host is counting unsent emails, that tells me they have an issue on their end, and are incapable of determining if mail was sent properly. How they would fix it I haven't a clue.
But it doesn't appear to be your PHP code. You could clean it up a bit, remove redundancy in the loop from static strings, and verify emails and whatnots, but all and all it looks like it will run properly.
We also started getting the error message 'No recipient addresses found in header', which has never been there before and we haven't altered any of our php code.
I've already commented on this. Your hosts php / sendmail configuration has changed. Those blank emails addresses you mentioned earlier were previously not being reported to you but now they are. It's probably always been a problem but because you never saw any error messages you thought it was ok.
Sounds like your host has tinkered with the error reporting settings (and a few others).
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
Thanks, it makes sense now why that error started popping up out of nowhere. Problem is even when we change the query to only get the emails that aren't blank none of the emails send. We don't get the 'no recipiants' message anymore but the php mail still isn't working.
It seems like the problem is on our hosting company's end but they aren't cooporating and insist nothing has changed.
Thanks, it makes sense now why that error started popping up out of nowhere. Problem is even when we change the query to only get the emails that aren't blank none of the emails send. We don't get the 'no recipiants' message anymore but the php mail still isn't working.
It seems like the problem is on our hosting company's end but they aren't cooporating and insist nothing has changed.
Don't forget you don't need to actually send email. Log the results to a file instead of mailing to see what's going on, or even print them to the screen.
Yeah, to me it still reeks of the host configurations, and its almost like their not sure what they did to break it.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
So now we were told we need to specify the relay server in our code for this to work. I have the server address given to us but i'm not sure how to go about adding it. Any ideas?
Our host is godaddy by the way, from hours spent online looking into this it's a common problem people have with them and everyone seems to solve the problem in a different way. Sigh..
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
Yeah, phpmailer will use direct sockets to manage the mail I believe.
As for godaddy, yes these have been hit or miss. I've seen half of the posts working with godaddy mail() and the other half not (not just you, user wise).
What they want you to do is pass the information required over to a script that sends. I don't know the fields I'm afraid, but they should have a FAQ with what you can use. You can do it directly by changing your form action to point at their scripts, or you can submit your forms, and use curl to submit it to their forms. For what you have here, you'd need to curl (I'm pretty sure if I recall previous posts on their forms, it is passed by post). I'd suspect that you'll have a full FAQ and tutorial somewhere on their site to guide you through setting this up.
After messing around with this for a while I've found some php mail code that works. Can't say I understand why this works and our other code didn't but it's posted below. Thanks all
PHP Code:
mysql_connect("dbserver", "dbusername", "dbpassword") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());
$result = mysql_query("SELECT email FROM email_list WHERE email != '' ") or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$message = "<html><body><center>
<table border='0' bgcolor='#8a6754' width='850'>
<tr><td align='center'><img src='http://website/images/logo.png'></td></tr>
<tr><td align='center'><font color='#ffffff'>The newsletter for website.com has been updated. To view it, <a
href='http://website.com/newsletter.php'>click here</a><br><br><br>
<em>Adobe Acrobat Reader is needed to view this newsletter. To download this free software click the link below</em><br>
http://get.adobe.com/reader<br><br>
</font></td></tr></center></body></html>";
$mail= mail("$email", "subject", "$message", "$headers");
}}}
if ($mail) {
echo "<font color='#ffffff'><br><br><em>A notification was successfully sent to the mailing list.<br></em></font>";}
else if (!$mail){
echo "<font color='#ffffff'><br><em>There was an error, please try again later.</em></font>";}
?>
Are you sure? The $mail check only occurs after all the looping is complete, so it will only contain the last result of the mail() call.
Not sure why that may change it. Neither the mime or the return-path are required.
You should look into using the Pear mail package. It's better than using mail if you want to bulk it up.
After messing around with this for a while I've found some php mail code that works. Can't say I understand why this works and our other code didn't but it's posted below. Thanks all
If you are still having any issues I would be more than happy to look into this issue if you PM me your account number or domain name.