emails sent with mail() get blocked by some mail servers

Hi there.

I’m having trouble with sending mail using a php form. I’ve made a form that will let people at my work send personalized html/css-formatted “brochure” emails to clients.

The form works and everything, but some clients complain that they haven’t received theirs (and it isn’t found in their spam folder either). This appears to happen consistently with certain mail providers and mail servers (including our own). I suspect it’s something to do with the server’s anti-spam procedures.

Does anyone know a way around this? There must be one, as while we aren’t able to receive these emails sent with this php script, I was still able to get, for example, the activation email sent from this forum, presumably through php.

I’ve included info on the ‘from’ variable of this form, in case there’s something in it which might be why we’re getting blocked.

[code]$from = "From: $formFromName <$formFromEmail>nReply-To: $formFromEmailnContent-Type: text/html; charset=“windows-1251"rnMIME-Version: 1.0”;

mail($formToEmail, $subject, $message, $from);
Thanks for reading.

most times it helps to send a multipart (html and plaintext) email.

mails that are only html (like the one u r sending) r filtered by a lots of servers.

btw: windows-1251 isn’t a good charset to use. try ISO-8895-1

Well, this is a difficult issue as there are multiple issues to deal with.

First of all you have to realize that you will not have control over the recipient’s mail server (generally), and what they chose to block and let through is up to them. It’s unfortunate that the SPAM has brought us to this point, but it’s now a fact of life.

Although there are things you can do to “Improve” your chances of getting your email through, there is no guarantee. Sending a properly formed email (including the mime type, etc…) is very important. Many MTU’s and even clients have not, at least in the past, been strict about all the rules and would let things slide, as it were. Again, Spam is making this less so.

Good spelling is also important (Sorry Q1712). Of course all those Spam emails do whatever they can to get things through, like using a Zero instead of the Letter O (oh…) which is obviously a misspelling. These filters now look for things like this.

Probably the most important thing you can do is see the “Bounce” message and address them. I have had issues here because this forum is run on a DSL (with a static IP) but because of how my IP address is reported some ISPs see it as a DHCP Address and block it. Usually, a quick phone call or email gets me on the white list, but you have to follow up on those bounce messages. This generally means you need to chug through other bounced messages which are a result of forged spam. But these are things you may have to do.

I don’t necessarily think your issue is one of a programming, but rather the other issues pointed out above and others that are similar.

Good luck with the endeavor. If you find a way around all those spam filters… Keep it to yourself so that the spammers don’t get it.

paul is right. there are hundreds of things u can improve. and there are no guarantees.

had two years dealing with emails and spam filters and still don’t know all.
there are whitelists/blacklists for everything IP’s, email-addresses, headers, content a.s.o. and of cause the providers will keep that secret (otherwise the spammers would know what to do). but i actualy found out (if everything else is OK) making a html-mail a multipart-mail mkes it go from hell to heaven. But of cause if there are more spam-indicators inside ur mail it will not help.

Thanks for the responses.

It looks like I have my work cut out for me. I don’t really know anything about how to send multipart emails, what constitutes a ‘properly formed email’, or even what this “Bounce” message is. Perhaps I’ll be better off finding another way entirely to do this. For example, I could teach everyone at my company how to send email stationery from their email programs instead (actually a lot harder than it sounds). A rather lame solution but it might be my best option.

Incidentally do you think this might help me out at all?

had only a quick look at it, but it seems to what u need to make the mails well-formated, try to sent images that may be in there as an “attachment” as well.

in the end u may wanna post the email here again. so we could have a quick look at it, so that we may find some more spam-indicators.

good luck

Changing the WAY you generate the message (i.e teaching the masses to do “Stationary”) will not necessarily effect the outcome as they emails will still be subject to the same scrutiny as an automated one would be.

In my eyes, the best thing to do (First) is to check those “Bounce” messages as they will actually give you a lot of information. (in a very short message).

Google (or your other favorite search engine) should be come your best friend. Use it to “Answer” your questions of the BOUNCE messages.

A Bounce message is that message that comes BACK when an email fails. Many Mailers will send them with a description of the problem.


The original message was received at Fri, 26 Oct 2007 12:32:19 -0400 from localhost.localdomain []

----- The following addresses had permanent fatal errors ----- [email protected]
(reason: 550 5.1.1 [email protected]: Recipient address rejected: User unknown in virtual mailbox table)

----- Transcript of session follows ----- … while talking to

<<< 550 5.1.1 [email protected]: Recipient address rejected: User unknown in virtual mailbox table 550 5.1.1 [email protected]… User unknown <<< 554 5.5.1 Error: no valid recipients

This email bounced (a spammer trying to register on this forum) because it’s NOT A VALID EMAIL (Note the user unknown part)

Another example is:

The original message was received at Thu, 11 Oct 2007 20:06:03 -0400 from localhost.localdomain []

----- The following addresses had permanent fatal errors ----- [email protected]
(reason: 554-: (RLY:IR)

----- Transcript of session follows ----- … while talking to

<<< 554-: (RLY:IR)
554 5.0.0 Service unavailable

Note the URL in the message. If you check it out… It will give you more information as to why AOL is denying emails from one of my domains…

Generally the “Bounces” Come from Postmaster, Admin, Mailer-Dameon, Mail-Delivery Subsystem, System Administrator or some other "Administrative/Postmaster type account.

To view the “Bounce” Messages, the “Reply To” Address should be a VALID address, even if you don’t check it regularly (and tell the “Recipient” that it’s not a monitored account), otherwise, the bounce message will get lost too.

I know it’s a lot to grasp, but I think it can help you to where you need to go. I guess you also need to accept that there are some users that are NOT going to get the email (or at least through your automated processes) and that those you will have to deal with on a case by case.

Actually peg, I’ve never received a bounceback message from using this kind of form, which is why I assumed you meant something else when you said “bounce” message. I’ve only ever received a bounce message when someone’s mailbox is full or something of that nature.

Anyway I think I have a good amount of info to explore further. Thanks for your help.

Sponsor our Newsletter | Privacy Policy | Terms of Service