Jump to content

PHP Mail


jandrews3

Recommended Posts

I've got something really weird that I don't understand. I'm having trouble sending php email. I'm sending three similar emails to different addresses ... one to the student, one to the teacher, and one to the parents. All of my tests run fine while I'm sending them all to 3 different email addresses all based at JAMESA3.COM. But when I change one of the email addresses to something else ... a parent email address, my school email address, or anything other than something at jamesa3.com, then it doesn't arrive. I get every indication that it sends, it just never arrives.

 

$to = $email1;

$subject = "Online Quiz Writing Assignment";

$body = $fname." ".$lname.", This is an automatic notification for your online vocabulary quiz taken on ".date("D, j M Y H:i:s A")." from IP address ".$ip.".";

$count=1;

while ($tomra[$count]){

$body = $body."\n".$tomra[$count];

$count++;}

 

$headers = "From: [email protected]\r\nCC: [email protected]\r\n" .

    "X-Mailer: php\r\n";

if (mail($to, $subject, $body, $headers)) {

  echo("<p>Sent to ".$fname." ".$lname." at email ".$email."</p>");

} else {

  echo("<p>Message delivery failed...</p>");

}

 

 

$to = $email2;

$subject = "Online Quiz Writing Assignment";

$body = $fname." ".$lname.", This is an automatic notification for your online vocabulary quiz taken on ".date("D, j M Y H:i:s A")." from IP address ".$ip.".";

 

$headers = "From: [email protected]\r\n" .

    "X-Mailer: php";

if (mail($to, $subject, $body, $headers)) {

  echo("<p>Sent to ".$fname." ".$lname." at email ".$email."</p>");

} else {

  echo("<p>Message delivery failed...</p>");

}

 

 

$to = $email3;

$subject = "Your Childs Quiz Grade";

$body = "Dear Mr. and Mrs. ".$lname.",\n  This is an automatic notification for an online vocabulary quiz.";

 

$headers = "From: [email protected]\r\n" .

    "X-Mailer: php";

if (mail($to, $subject, $body, $headers)) {

  echo("<p>Sent to ".$fname." ".$lname." at email ".$email."</p>");

} else {

  echo("<p>Message delivery failed...</p>");

}

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/74807-php-mail/
Share on other sites

I think I solved part of the issue. It appears the email address (my school email) wouldn't work as a destination but a newly created yahoo email address would. I guess there are some servers out there which don't allow the reception of php mail? Is that right?

 

Link to comment
https://forums.phpfreaks.com/topic/74807-php-mail/#findComment-378256
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.