Hardware Reference
In-Depth Information
--body-plain : The e-mail message text, which can alternatively be
composed as HTML together with the --body-html option.
You may have to authenticate to the SMTP server with a username and password,
in which case, the --user and --pass options will take care of that.
For our next example, we'll use Gmail to send a message with a WAV file attachment:
pi@raspberrypi ~ $ smtp-cli --verbose --server smtp.gmail.com:587 --user
secret.agent --pass mypassword --from "Secret Agent <secret.agent@
gmail.com>" --to "Fellow Peer <fellow.peer@agenthq.com>" --subject "Pi
Reporting" --body-plain "This is a another test email" --attach ~/
myrecording.wav
If the e-mail delivery fails, it's likely that you've received an e-mail in your Gmail
inbox with the subject sign-in attempt blocked. To allow smtp-cli to send mail, you
will need to enable "less secure apps" by visiting the link in that e-mail. Alternatively,
you can find it under the security settings of your Gmail account.
Once you've verified that e-mail sending works, you can drop the --verbose option
and use your command in scripts with variables for some of the options.
Sending e-mail through Gmail from the command line
 
Search WWH ::




Custom Search