Jump to content

php mail function can't send email


colap

Recommended Posts

I have installed ssmtp on debian.

/etc/ssmtp/ssmtp.conf looks like this below:

[email protected]
mailhub=smtp.gmail.com:587
#rewriteDomain=
hostname=mybox
UseSTARTTLS=YES
[email protected]
AuthPass=[mypassword]
FromLineOverride=YES

php mail function:

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

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

From apache error.log i get this message:

sendmail: Authorization failed (534 5.7.14 https://support.google.com/mail/answer/78754 nz12sm1965155pdb.49 - gsmtp

Which software is used to send mail with php for debian and windows?

 

1)sendmail

2)ssmtp

3)msmtp

Link to comment
https://forums.phpfreaks.com/topic/296634-php-mail-function-cant-send-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.