
- UBUTNTU SEND MAIL USING SSMTP FROM PHP INSTALL
- UBUTNTU SEND MAIL USING SSMTP FROM PHP UPDATE
- UBUTNTU SEND MAIL USING SSMTP FROM PHP PASSWORD
- UBUTNTU SEND MAIL USING SSMTP FROM PHP FREE
With SMTP you can overcome this issue, SMTP is the most recommended way to send email from the PHP script.

Sometimes it may cause issues on sending an email and fails to deliver mail to the recipient. When you sending an email using the mail() function in PHP, the mail is sent from your web server. Basically, PHP mail() function is used to send email from the PHP script. Smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.Send email from the script is the most used functionality in the web application.

# list of CAs to trust when verifying server certificate # use sasl when authenticating to foreign SMTP servers Smtpd_tls_session_cache_database = btree:$/smtp_scache Smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key Smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem # Uncomment the next line to generate "delayed mail" warnings Smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)

Mydestination = raspberrypi, localhost.localdomain, localhost Join us on twitter and facebook for more updates. Do not miss out on our other helpful tutorials. You can run test again after unlocking captcha. You need to unlock the captcha by visiting this page So use wisely! 🙂 TroubleshootingĮrror: “SASL authentication failed server ” Please note that Gmail’s SMTP server has a limit of 500 emails per day. This method will be useful if you have many sites on your server and want them all to send emails via Gmail’s SMTP server.Īlternatively, you can use a plugin like WP Mail SMTP so that mails from your particular WordPress site will be sent using Gmail’s SMTP server. Once configured, all emails from your server will be sent via Gmail. This logging is one strong reason that we often use Gmail when mail delivery is critical. By default, Gmail always keeps a copy of mail being sent through its web-interface as well as SMTP server.
UBUTNTU SEND MAIL USING SSMTP FROM PHP PASSWORD
To further verify, if mail sent from above command is actually sent via Gmail’s SMTP server, you can log into Gmail account with PASSWORD and check “Sent Mail” folder in that Gmail account. echo "Test mail from postfix" | mail -s "Test Postfix" If you have configured everything correctly, following command should generate a test mail from your server to your mailbox. Thanks Alexander Bakker for the note.įinally, reload postfix config for changes to take effect: sudo /etc/init.d/postfix reload Testing Check if mails are sent via Gmail SMTP server Note: If you run into issues with above command, try changing certificate name to thawte_Primary_Root_CA.pem in above command. Just run following command: cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem Next, validate certificates to avoid running into error.
UBUTNTU SEND MAIL USING SSMTP FROM PHP UPDATE
If you want to use your Google App’s domain, please replace your permission and update postfix config to use sasl_passwd file: sudo chmod 400 /etc/postfix/sasl_passwd Open/Create vim /etc/postfix/sasl_passwdĪnd add following line: :587 :PASSWORD You might have noticed that we haven’t specified our Gmail username and password in above lines. Smtp_tls_CAfile = /etc/postfix/cacert.pem

Smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd Then open your postfix config file: vim /etc/postfix/main.cfĪnd following lines to it: relayhost = :587 Just select your server as Internet Site and for FQDN use something like If you do not have postfix installed before, postfix configuration wizard will ask you some questions.
UBUTNTU SEND MAIL USING SSMTP FROM PHP INSTALL
Relaying Postfix mails via :įirst, install all necessary packages: sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules
UBUTNTU SEND MAIL USING SSMTP FROM PHP FREE
If you face any issue, feel free to use comments-section below. If you want to use a Gmail account as a free SMTP server on your Ubuntu-Linux server, you will find this article useful. Update: This article is part of WordPress-Nginx tutorials series.
