How To Send Email from Gmail or SMTP via Linux Command
In our earlier tutorial we had discussed about SSMTP for sending email through SMTP server via command line. This tutorial makes this process much easier using the sendemail command line utility. SendEmail is a Lightweight command line SMTP email client for sending emails through the SMTP server. In this article, we have described how to install sendemail package and a few examples for sending email through remote SMTP server like Gmail.
Install SendEmail Package
SendEmail SMTP client is available under default Ubuntu repositories, Use following commands to install it.
Send Email through SMTP
Example 1:-
In this example email body text is passed as argument (-o message-file=/tmp/mailbody.txt) in command.
Example 2:-
In this example, email body text is passed as piped input from other command output. You can also include cc and bcc email address as well.
目前這個方式,您的gmail需要將低安全性應用程式打開。如果可以設定為2階段認證的,您可以使用mutt去發送e-mail,mutt發送在在ubuntu發送信件e-mail的5個方法有介紹。
留言
張貼留言