0

I am sending email using mail() The problem is I am not getting an email to a specific email id if the recipient id does not exists, I have tried the following code.

$email="abcdt01est@gmail.com";
$usermsg="some message here";
$subject = 'Your Account Registration Confirmation';
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";    
$headers .= "From: Our Team <team@test.com>" . "\r\n";              
$headers.="Return-Path:<my email id goes here>\r\n";
mail($email, $subject, $usermsg, $headers); 

I have also tried with

mail("abcdt01est@gmail.com", "subject", "body of message", "From: team@test.com", "-f<my email id>");  
Srikanta
  • 111
  • 1
  • 1
  • 8

1 Answers1

0

Mail function in PHP mail() only informs about E-Mail has been accepted by the outgoing server, and plays no role in checking E-Mail's actual delivery status.

You can check your mail log /var/log/mail.log if sendmail is configured properly.

Visit this http://www.phpclasses.org/package/9-PHP-PHP-mailer-to-compose-and-send-MIME-messages.html - MIME E-mail message sending: PHP mailer to compose and send MIME messages.

Rohit Nigam
  • 708
  • 8
  • 23