Use In DebianExim4Email sending is cumbersome. I will introduce you to the following two methods.
Use exim4 to send emails In Debian
Method 1: Send mail directly using SMTP
# Dpkg-reconfigure exim4-config
(1) split the configuration document into small files? No
(2) Select the first option and use SMTP to send emails directly.
(3) system email name (I wrote admin @ ip here)
(4) IP address of the inbound SMTP connection to be monitored:
127.0.0.1 (in this way, only the local machine can use exim4)
* (Applicable to all users)
192.168.0.0/24, which is applicable only to the IP Range
(5) other acceptable email destination addresses: (empty)
(6) forward emails to these hosts: (empty)
(7) Do I keep the minimum DNS query volume (Dial-on-Demand as needed )? No
Method 2: Use smarthost to send mail
(1) split the configuration document into small files? No
(2) Select "send with smarthost; no local mail"
(3) system email name (I wrote admin @ ip here)
(4) IP address of the inbound SMTP connection to be monitored:
127.0.0.1 (in this way, only the local machine can use exim4)
* (Applicable to all users)
192.168.0.0/24, which is applicable only to the IP Range
(5) other acceptable email destination addresses: (empty)
(6) forward emails to these hosts: (empty)
(7) Machines responsible for processing mails sent from the Local Machine (smarthost): the smtp address actually used for outgoing mails (smtp.gmail.com is used here)
(8) Do I keep the minimum DNS query volume (Dial-on-Demand as needed )? No
You also need to modify several configuration files:
(1)/etc/exim4/passwd. client, smtp account and password settings, add:
Help 12 stu.xjtu.edu.cn: flowaters@stu.xjtu.edu.cn: password gmail-smtp.l.google.com: admin@vixp.net: password
(2)/etc/email-addresses, system email address, add:
User: admin @ ip
Run the update-exim4.conf after configuration, and then restart the exim4 service.
Notes for sending emails using exim4 in web Services:
1. the user name for running the service is in the mail group, so that the mail permission is granted.
2. The mail log is under/var/mail/username /.
Through the above, we learned how to use Exim4 to send emails In Debian, hoping to help you.