Emails are not working on server?

Emails are essential tool / facility on web server to manage all communications among users.

Here are few issues:

1. Send mail function is not configured
2. No responsible mail server service on web server
3. Email port blocked
4. SMTP service
5. IP blacklist

How to fix:

1. Check Mail server (sendmail or postfix) on server

#  ps -aux  (check all processes for mail service)
#  chkconfig –list (check mail service)
#  rpm -qa | grep sendmail
#  rpm -qa | grep postfix

2. If there is no Mail server then install

#  yum search sendmail
#  uname -i (check server arch.)
#  yum install sendmail.x86_64 sendmail-cf.x86_64 sendmail-devel.i386 sendmail-devel.x86_64 sendmail-doc.x86_64
#  chkconfig –list
#  ps -aux
#  service sendmail start

3. Now create a test email.php file

<?php

$to = "[email protected]";
$subject="Testing mail....";
$message="Welcome to svnlabs.com";
mail($to, $subject, $message);

?>

4. If you still no mail yet… 🙁  Check mail logs

#  tail -f /var/log/maillog
#  less /var/spool/mail/root

5. Finally check network setting for DNS & SMTP

#  vi /etc/sysconfig/network
#  service sendmail restart

Configure sendmail see here

Alternative: PHP Gmailer

Gmailer allows sending outgoing mail via Gmail or Google Apps accounts.

* SMTP server address = ‘smtp.gmail.com’
* SMTP server port =’465′
* SMTP username and password = username & password registered at Gmail.
* Whether or not SSL should be used = SSL enabled
* From: email address and Sender’s name for outgoing mail.

Must Read…

https://www.svnlabs.com/blogs/linux-mail-servers/

https://www.svnlabs.com/blogs/no-route-to-host/

Formal education will make you a living. Self-education will make you a fortune. 😉