0

I have this script to send Email to a user on registration. The proble is that it sends to every email client except for AOL. This is is an issue as my client and her clients mainly use AOL Email. Is there something wrong with my code or is there a workaround? Thanks in advance.

$to = $EMSPosted_s; $subject = "Confirmation of Order";

 $message = "
 <html>
 <head>
 <title>Confirmation of Order</title>
    </head>
      <body>
 <h1>Welcome to your Here To Thrive Course!</h1>
 <h2>Hi ".$UNSPosted_s."</h2>
  <h3>Thank you for purchasing the Here To Thrive course from x</h3>

 <h5>Many thanks</h5>

 <h4>Louise</h4>

  <p>www.louiselloyd.life</p>
 </body>
  </html>";

 $headers = "MIME-Version: 1.0" . "\r\n";
 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";


$headers .= 'From: <confirmation@louiselloyd.life>' . "\r\n";
$headers .= 'Cc: louise@louiselloyd.life' . "\r\n";

  mail($to,$subject,$message,$headers);

  ?>

3 Answers3

0

Most likely IP reputation issue at AOL. Also you should use SMTP authentication to send email via script. If you are receiving any bounce from AOL, you should get help from their website.

For SMTP script, make sure you have setup SPF, DKIM, DMARC etc. for the domain which is being used for authentication.

Kailash Aghera
  • 494
  • 3
  • 7
0

PHP's default mail() function doesn't work most of the times, especially with GMail or with AOL as in your case. This is because your e-mail needs to be formatted in a special way to be accepted by certain mail servers. You'll be better off using a mail library like PHPMailer.

Here's how to send an e-mail using PHPMailer from a GMail Account.

    $mail = new PHPMailer();

    // ---------- adjust these lines ---------------------------------------
    $mail->Username = "xxx@gmail.com"; // your GMail user name
    $mail->Password = "passwd";  // your GMail Password
    $mail->AddAddress("yyy@gmail.com"); // recipients email
    $mail->FromName = "Your Name"; // readable name

    $mail->Subject = "Subject";
    $mail->Body    = "Body"; 

    $mail->Host = "smtp.gmail.com";
    $mail->Port = 465; // or 587
    $mail->IsSMTP(); // use SMTP
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->From = $mail->Username;

    //----------------------------------------------------------------------

    if(!$mail->Send())
    {
        echo "mail sent";
    }
Abdul Fatir
  • 6,159
  • 5
  • 31
  • 58
0

Try this code headers u haven't write it properly.

 $headers .= "MIME-Version: 1.0" . "\r\n";
 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";


$headers .= 'From: <confirmation@louiselloyd.life>' . "\r\n";
$headers .= 'Cc: louise@louiselloyd.life' . "\r\n";

  mail($to,$subject,$message,$headers);

  ?>
srinivas
  • 109
  • 12