我是树莓派的新手。
我在上面安装了raspian OS。我想使用我的Gmail帐户从中发送电子邮件。我想从命令行界面和php脚本发送。
我遵循了本指南。 http://iqjar.com/jar/sending-emails-from-the-raspberry-pi/
我从链接执行了步骤1,2,3,4。
当我使用以下代码发送电子邮件时,使用
echo "Test text" | mail -s "Test Mail" me2@gmail.com
什么也没发生,屏幕上没有任何打印,我也没有收到电子邮件。
在“ revaliases”上,如果我将“ mail.google”替换为“ smtp.gmail”,那么我会收到一条消息,说
send-mail: Cannot open mail.google.com:587
要么
send-mail: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. ml2sm3592928igb.10 - gsmtp)
有谁知道如何解决这一问题?谢谢
以下是两个文件:
ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
# mailhub=mail
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=raspberrypi
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
root=me@gmail.com
mailhub=smtp.gmail.com:587
AuthUser=me@gmail.com
AuthPass=mypass
UseSTARTTLS=YES
重制
# sSMTP aliases
#
# Format: local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:me@gmail.com:mail.google.com:587
UseSTARTTLS=NO
吗?