Hi I'm quite strong in php but weak in Linux, I wrote a simple script to send an email.........as the script uses if/else statements I get a success message as if the mail reaches the outgoing mail service but each time I never receive the email...no matter what to: address I use or however many times I try.
I don't have root access to the box I'm developing on but my boss does.....he got into the mail logs and here's what he saw......
tms1:/var/spool/exim4/msglog# cat *
2006-02-21 18:47:54 Received from www-data@ U=www-data P=local S=438
2006-02-21 18:47:56
juan_chandler@hotmail.com R=dnslookup T=remote_smtp: SMTP error from remote mailer after MAIL FROM:<www-data@> SIZE=1471: host mx3.hotmail.com [65.54.244.72]: 501 Invalid Address
Process failed (1) when writing error message to www-data@ (frozen)tms1:/var/spool/exim4/msglog#
What does this mean?
I can telnet in on port 25 and send email at the command line.
here's the php script I wrote
<?php
//Declarate the necessary variables
$mail_to="juan_chandler@hotmail.com";
$mail_from="Juan@theinternetgroup.com";
$mail_sub="Emailing with php";
$mail_mesg="This is a test to see if I am able to email using php";
//Check for success/failure of delivery
if(mail($mail_to,$mail_sub,$mail_mesg,"From:$mail_from/r/nReply-to:$mail_from")){
echo "E-mail has been sent successfully to $mail_to";
}
else{
echo "Failed to send the E-mail from $mail_sub to $mail_to";
}
?>
Can anyone help please?