$ echo "BEEP BEEP" | mailx -s "Subject: This is a test!" tallharry84@gmail.com send-mail: authentication failed (method PLAIN) send-mail: server message: 534-5.7.9 Application-specific password required. Learn more at send-mail: server message: 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor s8-20020a62e708000000b0051835ccc008sm2037121pfh.115 - gsmtp send-mail: could not send mail (account default from /home/pi/.msmtprc) send-mail: cannot log to /var/log/msmtp.log: cannot open: Permission denied send-mail: log info was: host=smtp.gmail.com tls=on auth=on user=tallharry84 from=tallharry84@gmail.com recipients=tallharry84@gmail.com smtpstatus=534 smtpmsg='534-5.7.9 Application-specific password required. Learn more at\n534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor s8-20020a62e708000000b0051835ccc008sm2037121pfh.115 - gsmtp' errormsg='authentication failed (method PLAIN)' exitcode=EX_NOPERM Can't send mail: sendmail process failed with error code 77 $