I was trying to send an e-mail from the terminal, but it doesn't work and I can't find the reason. My .msmtprc file is:

account default
host smtp.gmail.com
port 587
from account@gmail.com
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user account@gmail.com
password password
logfile ~/.msmtp

(instead of account and password, of course, I have my data written) Then I use command

msmtp -t < test.txt

and no mail is sent (test.txt contains To:, From:, Subject: and text)!

  • 2
    What does the log file say? – Robie Basak Feb 7 '13 at 11:05
  • 1
    Do you use 2 step authorization with gmail? – desgua Mar 9 '14 at 1:01
  • Do you have sendmail installed? are you looking to receive messages as well? – j0h Mar 3 '15 at 14:07
  • 1
    seems as if you miss out which account msmtp should use with msmtp -a default -t < test.txt the acount name is "default" but it was not configured as default account with account default : default within the configuration file – Bodo Hugo Barwich Nov 17 '17 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.