Search code examples
phpemailsmtpphpmailersendmail

How to solve - [sendmail: Error during delivery: Reply Code is not valid: ecur ]?


I'm trying to develop a basic PHP mail application for my homework/practice purpose. That why I'm working on my local development environment(XAMPP).

My php.ini code:

[mail function]
SMTP=mail.example.com
smtp_port=587
sendmail_from = info@example.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

My sendmail.ini code

[sendmail]
smtp_server=mail.example.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=info@example.com
auth_password=*********
force_sender=info@example.com

My used PHP code for send email:

$to      = 'example@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = array(
    'From' => 'webmaster@example.com',
    'Reply-To' => 'webmaster@example.com',
    'X-Mailer' => 'PHP/' . phpversion()
);

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

The following error occurred while sending the mail from the localhost.

sendmail: Error during delivery: Reply Code is not valid: ecur 

Has anyone else encountered this problem?

What could be the possible solution?


Solution

  • was enough with go to sendemai.ini and change this

    smtp_ssl=none
    

    And started to work