Jump to content

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: andrewsj@k12tn.net\r\nCC: service@alteredimpressions.com\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: andrewsj@k12tn.net\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: jandrews@k12tn.net\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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.