0

I have part of my project when my clients will reseive mail after so many actions, when I testing my mail function, I have problem when the adresse is to "gmail" , I reseive the mail, but when the mail is no-gmail, the mail not reseived !!! :( this is my mail function:

function emailDemande($email, $name, $nameL){

    $subject = 'Votre demande ';

    $headers = "From: XXX <contact@emoovio.com>\r\n";
    $headers .= "Bcc: abdelkhalek.oumaya@gmail.com, TEST@DOMAIN.com\r\n";
   // $headers = 'From: XXX <'. $from. '>\r\n';
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=UTF-8\r\n";

    $message='htmlmessage';

    mail($email, $subject, $message, $headers);
};
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

1

Mail is very complex in his flow.

Your Mail Headers and Content

The Sending Mail Server

Be sure the sending server (the smtp server) knows and allows the sender mail address to mail from.

Blacklist

Check if your smtp server is blacklisted. More info: http://mxtoolbox.com/blacklists.aspx

External Mail Service

  • I recommend to use external mail services, like Mailgun (http://mailgun.com). Mailgun provides an API for sending, receiving and tracking mail. A great advantage is that your own mail server (or global ip) cannot be blacklisted.
  • For testing your mail functionality, you can use Mailtrap (https://mailtrap.io).
schellingerht
  • 5,726
  • 2
  • 28
  • 56