Configure sendmail on CentOS to send mails from server?

Jovani

Active member
Joined
Jul 10, 2012
Messages
335
Points
28
Hi there,

Are there any ways how to configure sendmail on CentOS to send mails from server?

thanks in advanced :)
 

Alex Thompson

Moderator
Joined
Jun 6, 2013
Messages
652
Points
43
Hi there,

Are there any ways how to configure sendmail on CentOS to send mails from server?

thanks in advanced :)
If you simply want your server can send mail to the outside, you can use sendmail application. Once installed and configured, you can use the mail() function of PHP to send mail.

Install sendmail

Code:
sudo yum install sendmail sendmail-cf
Configuring sendmail

Code:
nano /etc/mail/sendmail.mc
Note not edit sendmail.cf file because this file is automatically generated from sendmail.mc file

Configure DAEMON_OPTIONS to allow sending mail from localhost/smtp

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Edit LOCAL_DOMAIN to hostname

Code:
LOCAL_DOMAIN(`example.com')dnl
Update sendmail configuration

Code:
sudo make -C /etc/mail
Restart

Code:
sudo service sendmail restart
Check sendmail

Code:
echo "Subject: your subject" | /usr/lib/sendmail -v [email protected]
In order to facilitate the sending of mail, you should note hostname in CentOS install exactly.
 
Older threads
Replies
2
Views
3,427
Replies
4
Views
4,053
Replies
13
Views
5,263
Newer threads
Replies
5
Views
4,784
Replies
0
Views
3,115
Replies
0
Views
3,039
Replies
3
Views
3,731
Latest threads
Replies
3
Views
42
Replies
2
Views
37
Replies
2
Views
20
Replies
2
Views
26
Replies
4
Views
56
Recommended threads
Replies
1
Views
2,557
Replies
3
Views
804
Replies
6
Views
3,643
Replies
6
Views
2,519

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top