Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send php mail, appear in hotmail "This message may be dangerous. "

Status
Not open for further replies.

flyclassic22

Technical User
Oct 1, 2002
54
SG
Hi,

I've tried sending email with php, with the following script:

$headers ="From: Webmaster<flydx_007@msn.com>\r\nReply-To: Webmaster<flydx_007@msn.com>";

$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($emailadd, $subject, $message, $headers);

blablabla

however when i received at hotmail, it was stated as
"This message may be dangerous. ".
"This message has been blocked for your safety. Open message "
I still able to open the email, when i click "open message" has anyone experience this problem? how do i avoid this ? any special headers to include?
 
Your emails may be getting treated as spam.
I came up against a similar problem in a mailer program written in Perl where the ISP's Spam Assassin rejected all my attempts at mailing. The test emails I sent contained a small amount of text and were rejected, they were only accepted when I increaed the amount of content within the body and added a disclaimer paragraph at the end.
Obviously, the people responsible for spam filters are not going to point out why the content was rejected so a bit of experimenting has to be done.

Keith
 
i tried , still filtered as spam... how do other people do it so that it doesnt look like spam? anyone has examples?
I am trying to do a html email
 
Is the content of the mail something that might legitimately be flagged as spam?
Think carefully on this question. Sorry, but I had to ask.

If you are absolutely positive that your email couldn't be construed as spam then you might want to try modifying the return-path header.
I think the anti-spam system looks to see if the return path matches the sender's domain.

Do this by adding -f myname@mydomain.com (with your legitimate domain name) to the headers.
I have had success with this when trying to negotiate AOL's system.

At the very least you may find that Hotmail will return an error message to that address which will help you troubleshoot the problem.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Do this by adding -f myname@mydomain.com (with your legitimate domain name) to the headers.
I have had success with this when trying to negotiate AOL's system."


sorry, can you give me examples? how do i add -f into my headers?
 
Actually, I should have said that you can add additional "Parameters", not "Headers". Although you might want to add some of these too.

The PHP mail function is structured thus:

Code:
mail  ( string $to  , string $subject  , string $message  [, string $additional_headers  [, string $additional_parameters  ]] )

At it's most basic you must specify a to, subject, and message parameter.

You can also optionally specify additional headers and parameters that get added to the mail when it is sent.

So, for instance you could do:

Code:
mail("mail@domain.com","Demonstration","This is a test",[COLOR=green]"From: My proper name <me@mydomain.com>\r\n" ."Reply-To: me@mydomain.com\r\n" . "X-Mailer: PHP/" . phpversion()[/color], [COLOR=red]"-f me@mydomain.com"[/color]);

The green bits are additional headers that get added to the mail.
The red is the additional parameter sent to whatever is sending the mail on your setup (SendMail for example).

Be aware that the PHP manual does say this about using additional parameters:

The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.

But try it, and look at the headers of a mail sent using this method to see if anything untoward is in there.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top