Thank you for your reply,#2.But it does not work yet .The .msmtprc's content is:
#Set default values for all following accounts
defaults
tls on
tls_trust_file /etc/pki/tls/certs/ca-bundle.crt
logfile ~/Mail/msmtplog
# Gmail service
account gmail
host smtp.gmail.com
from
niubl967@gmail.com
auth on
user niubl967
password passwd
#port 587
# A freemail service
#account freemail
#host smtp.freemail.example
#from
joe_smith@freemail.example
#auth on
#user joe.smith
#password secret
# A second mail address at the same freemail service
#account freemail2 : freemail
#from
joey@freemail.example
# The SMTP server of the provider.
#account provider
#host mail.provider.example
#from
smithjoe@provider.example
#auth on
#user 123456789
#password my_password
# Set a default account
account default : gmail
-----------------------------
Hope for help.