1

I am using mail() function in cakephp 2 to send the mail in the server. The mail is not delivered.

PHP - 5.6

Code:

$headers = 'MIME-Version: 1.0' . "\r\n";
 $headers.= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
$headers.= "From: " . $from . "\n"; 
$mail = mail($to, $subject, $message, $headers); 
 echo 'Mailer error: ' . $mail->ErrorInfo;

phpinfo screenshot below: enter image description here

There is no error message is showing. The mail sending status is true. but mail is not receiving.

Aswini
  • 11
  • 2
  • CakePHP doesn't interfere with PHP's native `mail()` function in any way whatsoever. If it's not working, then that's up to your PHP config / sendmail target. – ndm May 21 '22 at 19:38
  • @ndm Thanks for the response. What kind of setup need to be done ? i have attachment of phpinfo in the question. – Aswini May 22 '22 at 12:41

1 Answers1

0

if you are on your local machine , it won't work until you configure your local mail server. Most cpanels support php mail() function , but you need manual configuration for sendmail on your local machine / LAMP stack / vps server.

  • thanks for the response. i am checking this mail functionality in the server not in local machine. any other suggestions? – Aswini May 22 '22 at 12:13