steelerman99 Posted May 25, 2009 Share Posted May 25, 2009 Hey all! I have a database of users and their email addresses listed. One page sends each user some information that is unique to them. So, I have a loop that queries their record from a database, puts their unique information in an email, and sends it out. I can't send a mass email (eg with 100 addresses in the 'To:' header) because each email is different and unique to the user, so I'm calling the mail() function in a loop: (Pseudocode) foreach(record in db) { mail(unique message); } The code works fine, however, some users are not getting the email for one reason or another, even though the mail function executes successfully on EVERY iteration. I suppose their mail servers are considering it spam or something similar. Is there any way to prevent the messages from being considered spam and making sure they get through to the users? Thanks!! Quote Link to comment Share on other sites More sharing options...
kevinkorb Posted May 25, 2009 Share Posted May 25, 2009 Also look at your mail logs, it will help you see if your sendmail failed on sending email messages. Another thing you can do is just test your messages to different mail servers that run anti-spam software. Most of the servers that detect the spam will add that data and the spam score to the emails and then you can see why they thought it was spam. Quote Link to comment Share on other sites More sharing options...
steelerman99 Posted May 25, 2009 Author Share Posted May 25, 2009 Also look at your mail logs, it will help you see if your sendmail failed on sending email messages. Another thing you can do is just test your messages to different mail servers that run anti-spam software. Most of the servers that detect the spam will add that data and the spam score to the emails and then you can see why they thought it was spam. Thanks. I do know that all the mail is sending successfully - when the mail function returns true, I print out on the page who the mail was sent to. I have not seen a failed message print out yet. Is there anything that I could put on the existing message (extra header or what not) that would not make it be flagged as spam? Also, how would I obtain the spam data from the other servers? Quote Link to comment Share on other sites More sharing options...
kevinkorb Posted May 26, 2009 Share Posted May 26, 2009 Actually the mail() not returning an error didn't mean it successfully left your server, it just means the command ran correctly. If there was a problem with the email address, or the mail server the email address was hosted on then you would find those errors in your maillog. If you're on a *nix look at /var/log/mail.log or something similar. The main things about not getting caught as spam is keep very few images, a decent amount of text. As far as testing on an account with anti-spam software, I'm have no good recommendations on that. Sorry. Quote Link to comment Share on other sites More sharing options...
steelerman99 Posted May 26, 2009 Author Share Posted May 26, 2009 Actually the mail() not returning an error didn't mean it successfully left your server, it just means the command ran correctly. If there was a problem with the email address, or the mail server the email address was hosted on then you would find those errors in your maillog. If you're on a *nix look at /var/log/mail.log or something similar. The main things about not getting caught as spam is keep very few images, a decent amount of text. As far as testing on an account with anti-spam software, I'm have no good recommendations on that. Sorry. I'm using cpanel on bluehost. How do I access my mail logs? Quote Link to comment 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.