In view of 5.7 laravel app I use themsaid/laravel-mail-preview plugin for testing of emails sending with snowfire/beautymail templates and for this in .env of my local project I have options:
MAIL_DRIVER=preview
# MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
that works ok and into "/storage/email-previews" subdirectory of my local system generated emails are copied.
But moving to my server app (ubuntu 18 under Digital ocean) I have a problem that emails are sent and receivers do not receive it. On my server I have installed ssmtp and in file /etc/ssmtp/ssmtp.conf I added creditials of my gmail account and when I send testing email with mail($to, $subject, $message, $headers) function receivers receive these emails ok
But why I do not receive emails witch are sent with snowfire/beautymail templates ?
In .env of my server app:
MAIL_DRIVER=smtp
# MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=587
[email protected] # the same parameters I have in /etc/ssmtp/ssmtp.conf
MAIL_PASSWORD=XXXXXXXXXXXXXXXX # my gmail factor authentication password
MAIL_ENCRYPTION=null
In logs I see
# grep -riI ssmtp /var/log
/var/log/syslog.1:Nov 5 23:34:06 nsn-do-lamp sSMTP[3432]: Sent mail for [email protected]:587 (221 2.0.0 closing connection w18-v6sm13037750wrn.66 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 00:34:06 nsn-do-lamp sSMTP[4242]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 00:34:06 nsn-do-lamp sSMTP[4242]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 00:34:08 nsn-do-lamp sSMTP[4242]: Sent mail for [email protected]:587 (221 2.0.0 closing connection b71-v6sm476787wma.13 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 01:34:07 nsn-do-lamp sSMTP[5342]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 01:34:07 nsn-do-lamp sSMTP[5342]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 01:34:09 nsn-do-lamp sSMTP[5342]: Sent mail for [email protected]:587 (221 2.0.0 closing connection c24-v6sm77924472wre.44 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 02:34:07 nsn-do-lamp sSMTP[6155]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 02:34:07 nsn-do-lamp sSMTP[6155]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 02:34:08 nsn-do-lamp sSMTP[6155]: Sent mail for [email protected]:587 (221 2.0.0 closing connection m13-v6sm6126322wrw.14 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 03:34:07 nsn-do-lamp sSMTP[7181]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 03:34:08 nsn-do-lamp sSMTP[7181]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 03:34:09 nsn-do-lamp sSMTP[7181]: Sent mail for [email protected]:587 (221 2.0.0 closing connection t13-v6sm26521034wrn.22 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 04:34:04 nsn-do-lamp sSMTP[7905]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 04:34:04 nsn-do-lamp sSMTP[7905]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 04:34:06 nsn-do-lamp sSMTP[7905]: Sent mail for [email protected]:587 (221 2.0.0 closing connection v11-v6sm12069528wrt.40 - gsmtp) uid=0 username=root outbytes=860
/var/log/syslog.1:Nov 6 05:34:05 nsn-do-lamp sSMTP[8799]: Creating SSL connection to host
/var/log/syslog.1:Nov 6 05:34:05 nsn-do-lamp sSMTP[8799]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
/var/log/syslog.1:Nov 6 05:34:07 nsn-do-lamp sSMTP[8799]: Sent mail for [email protected]:587 (221 2.0.0 closing connection g16-v6sm20220322wrr.38 - gsmtp) uid=0 username=root outbytes=860
I have cron set at my server and message above looks like from this cron sending emails...
is it issue of my server's .env file? What can be wrong ?
MODIFIED BLOCK # 2: I modified .env of my app:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected] # the same parameters I have in /etc/ssmtp/ssmtp.conf
MAIL_PASSWORD=XXXXXXXXXXXXXXXX # my gmail factor authentication password
MAIL_ENCRYPTION=null
and cleared the cache But sending email I got error :
Expected response code 250 but got code "530", with message "530 5.7.0 Must issue a STARTTLS command first. r1-v6sm13862441wrt.59 - gsmtp "
What is wrong ?
Thanks!