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


$to = "";
$subject="Testing mail....";
$message="Welcome to";
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 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…

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

Open source – Port25

If you have trouble getting the PHP’s mail() function to work on your server.
If the function returned true, but never send the emails to target account.
Some ISP’s block port 25 (mail port), so you can’t send directly but you can send indirectly using your ISP’s mail server. 😉

Many email providers keep lists of IP addresses and block incoming mail, or move it immediately to a junk/spam folder.

Amazon Simple Notification Service Command Lines

There are some Open Source solutions to filter your mail problems..
You can check Open Source MTA here

Here list some MTAs as

  1. postfix
  2. qmail
  3. exim
  4. sendmail

Above MTA don’t handle integrated reporting, bounce management, and spam management, reporting.

PowerMTA: PowerMTA (this is not open source) provides the unique features and capabilities required by email service providers and enterprises to maximize the effectiveness of email marketing and customer communications, handle integrated reporting, bounce management, and spam management, reporting etc.