For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2007 > How to ensure that EMAIL from mail() do not goes into SPAM folder?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to ensure that EMAIL from mail() do not goes into SPAM folder?
Eric Layman

2007-02-14, 3:58 am

Hi,

Are there ways to prevent emails generated from mail() going into SPAM /
JUNK folder?

Pls advise.
Thanks.



Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
peter

2007-02-14, 3:58 am

> Are there ways to prevent emails generated from mail() going into SPAM /
> JUNK folder?


There is nor gauranteed way of ensuring emails do not go into spam boxes
however there are a few things you can do such as setting some of the mail
headers (you should see some tips in the php manual (check the user
comments)

Of course the content of the email can also affect if it happens so of
course avoid certain terms etc.


J.O. Aho

2007-02-14, 3:58 am

Eric Layman wrote:

> Are there ways to prevent emails generated from mail() going into SPAM /
> JUNK folder?


Don't copy headers from a mail sent with a normal mail client.
Have a Reply-To, From and Content-type that matches what is used in the mail.
X-Mailer header can be used to tell it's a PHP script used.

Myself I add X-Mailer-URL to tell where the sending script is located (full
url), X-Posting-Host with the remote users IP-number and X-HTTP-UserAgent
which tells what browser the remote user used and last X-Complaints-To which
is the e-mail address to contact if there been some abuse or if the script
been used by spammers (don't forget to check for header injections tries, if
you are using a mail form).

You then have to think about your Subject and how the body of the message
looks like, these affects also spam filtering. The more HTML and links you
have in your mail, the higher risk it's to be caught by a filter. Keep in mind
that the host where your script is run on may be in a blacklist (this is quite
common for dynamic-ip hosts).

There are never a 100% that a mail won't be caught by a filter, but you get a
lot of looking at the mail you got to your spam folder, if there isn't any
extra information in the mail or it's header, then contact your mail provider
and ask why it was filtered.


--

//Aho
shimmyshack

2007-02-14, 7:59 am

On Feb 14, 7:51 am, "J.O. Aho" <u...@example.net> wrote:
> Eric Layman wrote:
>
> Don't copy headers from a mail sent with a normal mail client.
> Have a Reply-To, From and Content-type that matches what is used in the mail.
> X-Mailer header can be used to tell it's a PHP script used.
>
> Myself I add X-Mailer-URL to tell where the sending script is located (full
> url), X-Posting-Host with the remote users IP-number and X-HTTP-UserAgent
> which tells what browser the remote user used and last X-Complaints-To which
> is the e-mail address to contact if there been some abuse or if the script
> been used by spammers (don't forget to check for header injections tries, if
> you are using a mail form).
>
> You then have to think about your Subject and how the body of the message
> looks like, these affects also spam filtering. The more HTML and links you
> have in your mail, the higher risk it's to be caught by a filter. Keep in mind
> that the host where your script is run on may be in a blacklist (this is quite
> common for dynamic-ip hosts).
>
> There are never a 100% that a mail won't be caught by a filter, but you get a
> lot of looking at the mail you got to your spam folder, if there isn't any
> extra information in the mail or it's header, then contact your mail provider
> and ask why it was filtered.
>
> --
>
> //Aho


have you investigated rDNS, it depends where you are sending from - if
it from your home server, on an ADSL or such like line and if you have
a decent ISP they will let you change the rDNS for your IP, from <ip-
in-reverse-order>.ISP.com to your FQDN for the email domain you are
seding. This allows mail server to track back and trust your domain -
because you are being up front about who you are. Otherwise it's pot
luck, with most aggressive servers simply assuming your are spam
because you mail comes from a DSL account.
If you're talking about a php script on a remote host you administer -
you will need to make sure your hosting company has a decent setup,
which will include decent DNS entries and so on.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com