Configuring the file .msmtprc on ubuntu

When we send a email by SMTP protocol on ubuntu, we can configure our default informations. The system will check two path to find the default information about your email.
The first is system configuration file /etc/msmtprc;
the second is user configuration file /home/xxx/.msmtprc(xxx is user name).
So we can configure the one of them theoretically, but now I only configured the second file .
For example, we can creat a new file .msmtprc in the folder /home/xxx/ configuring the 163 email as the default email, we can refer to the configuration file:

# Set default values for all following accounts.
defaults
# Create a folder /home/xxx/.var/log/msmtp/ to save the file .log
logfile /home/xxx/.var/log/msmtp/msmtp.log
# The SMTP server of the provider.
account 163
# Set SMTP service address
host smtp.163.com
# Set the sending email
from xxx@163.com
auth login
# set the login_account of email 
user xxx@163.com
# set the login_password of email 
password user_password
# Set a default account
account default : 163

we can check the configuration by the command :
echo -e “Subject: Test Mail\r\n\r\nThis is a test mail” |msmtp -debug -t xxx@xxx.
NOTE:

  1. “xxx@xxx” need to be your other email ,and receive the test eamil.
  2. all of operation is in user mode.

NOTE:

  1. If we check the configuration , maybe meet an issue :
    554 DT:SPM 163 smtp11,D8CowAB3ETB47DddflWCAg–.47523S2 1563946104,please see http://mail.163.com/help/help_spam_16.htm?ip=124.115.231.150&hostid=smtp11&time=1563946104
    we can open the link, get the following information:
    “554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件”.
    So maybe you need to modify your email content.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值