Mail problem

I apologise in advance for my little knowledges in php.
I use PHP 5.2.1
Here is an extract of the script which causes me problems.

//email of recipient
$ea='mister [at] somesite.com';

//tracking email to the webmaster of the site
$dd='webmaster [at] testsite.com';
mail($dd, 'Activation',$details, 'From: administration [at] testsite.com');

//prepar the body of the mail
$body = $name . ',';
$body .= "\n\nThank you for activating your account:\n\n\n";
$body .="http://www.testsite.com/fr/activation.php?x=$ts";
$body .= "\n\nSee you soon on www.testsite.com.";

//send the mail
mail($ea, 'Mail activation',$body, 'From: administration [at] testsite.com');

//second tracking email to webmaster of the site
$details="Mail sent to $ea";
mail('webmaster [at] testsite.com', 'Activation',$details, 'From:
administration [at] testsite.com');

Okay.
The problem :
I create a test user, fill out all the details giving one of my email
adress, on my own PC (but doing it on the live web site NOT IN LOCAL),
and click the activate button on the form. The script runs perfectly,
and after a few second I get the email in my mail box with the
activation link.
In the webmaster mailbox, I get the two tracking email. So far, so good.

Now, the webmaster create a user. This user on a different machine (two
users in differents places tried and had the problem), goes through the
same activation process, fills in his email address, and click the
activate button. He never receives his activation mail, but the
webmaster still gets the two tracking mails.

I tried on different machines, with different users, without success.
Can someone help me?

thank you.
Emmanuel Petit [ So, 24 Juni 2007 20:59 ] [ ID #1747369 ]

Re: Mail problem

Emmanuel Petit wrote:

> //second tracking email to webmaster of the site
> $details="Mail sent to $ea";
> mail('webmaster [at] testsite.com', 'Activation',$details, 'From:
> administration [at] testsite.com');

> I tried on different machines, with different users, without success.
> Can someone help me?
>
> thank you.

Typically this is due to email hitting the spam filter on the mailbox.
If you are running from your home IP address then there won't be much
you can do to stop this as most ISPs block home IP addresses from
sending mail. Have a look in the mail logs if you can, that may give
you a clue. You can improve the chances of the mail getting through by
doing:

$headers = 'From: Administrator <administration [at] testsite.com>' . "\r\n" .
'Reply-To: administration [at] testsite.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail('webmaster [at] testsite.com', 'Activation',$details, $headers,
'-fadministrator [at] testsite.com');

Note: The -f flag assumes the server isn't running Windows, if it is
remove that parameter from the command.

--
Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/
Windows is the path to the darkside...Windows leads to Blue Screen. Blue
Screen leads to downtime. Downtime leads to suffering...I sense much
Windows in you...
Andrew Hutchings [ Do, 28 Juni 2007 21:05 ] [ ID #1753678 ]
PHP » alt.php » Mail problem

Vorheriges Thema: PHP Uploader displays PHP Code in IE. Works fine in Firefox, Safari
Nächstes Thema: turn on FTP on linux