Linux serverNETWORK ADMINISTRATIONSsmtp server liux

Sending mails using php mail function on Ubuntu Linux server

In this video you get the answers of questions like, How to Send mails using PHP mail function on Ubuntu-Linux server? How to use a Gmail account as a free SMTP server on your Ubuntu-Linux server? How to send mails via Gmail SMTP server? How to configure postfix to send mail to gmail? Relaying Postfix mails via smtp.gmail.com?

sudo apt install ssmtp
sudo apt install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules
sudo nano /etc/postfix/main.cf
relayhost =[smtp.gamil.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

sudo nano /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 kumar@gmail.com:mypassword
sudo chmod 777 /etc/postfix/sasl_passwd
suod postmap /etc/postfix/sasl_passwd
sudo rm -f /etc/postfix/sasl_passwd

cat /etc/ssl/cert/thawte_Primary_Root_CA.pem | sudo tee -a /etc/postfix/cacert.pem
sudo systemctl reload postfix.service
echo ” test mail”| mail -s “test mail raj@gmail.com

source

by ArisTV India

linux smtp server

20 thoughts on “Sending mails using php mail function on Ubuntu Linux server

  • Dont work ubuntu 20.04 in 2022

  • Is a commande replace = ( cat /etc/ssl/cert/thawte_Primary_Root_CA.pem | sudo tee -a /etc/postfix/cacert.pem )

    cat /etc/ssl/certs/TWCA_Global_Root_CA.pem | sudo tee -a /etc/postfix/cacert.pem

  • Hi brother how to get this file "thawte_Primary_Root_CA.pem"

  • What do I do if I change my gmail password? I put the correct new credentials in sasl_passwd but still can't send emails? UPDATE: I just reinstalled the whole thing and it works now.

  • cat: /etc/ssl/cert/thawte_Primary_Root_CA.pem: No such file or directory
    that command giving me this error
    cat: /etc/ssl/cert/thawte_Primary_Root_CA.pem: No such file or directory

    can u check this

  • every command its working,but i didn't get the mail

  • try out this steps but not working for me. iam trying on ec2 ubuntu. cuould i have help

  • You are amazing! Thank you very much! Works like a charm on Linux Mint 19.3.

  • Thank for help but don´t work
    fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter

  • Please post the content of commands in Description of this Video

  • sudo apt install ssmtp

    sudo apt install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules

    sudo nano /etc/postfix/main.cf

    relayhost =[smtp.gamil.com]:587

    smtp_sasl_auth_enable = yes

    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

    smtp_sasl_security_options =noanonymous

    smtp_tls_CAfile = /etc/postfix/cacert.pem

    smtp_use_tls = yes

    sudo nano /etc/postfix/sasl_passwd

    [smtp.gmail.com]:587 kumar@gmail.com:mypassword

    sudo chmod 777 /etc/postfix/sasl_passwd

    suod postmap /etc/postfix/sasl_passwd

    sudo rm -f /etc/postfix/sasl_passwd

    cat /etc/ssl/cert/thawte_Primary_Root_CA.pem | sudo tee -a /etc/postfix/cacert.pem

    sudo systemctl reload postfix.service

    echo " test mail"| mail -s "test mail raj@gmail.com

  • I have configured the exim4 email server at Ubuntu 18.04. The email goes to spam. Please send me a solution at shakir0.saifi@gmail.com

Comments are closed.