Take the 2-minute tour ×

I am pretty new with the options of sending email via PHP code. The options available are sendmail, postfix, and PHPMail. If I use sendmail and postfix this means that I have to use PHP's mail function. I don't know about PHPMail. I will be sending email across domains (hotmail, yahoo, gmail, etc). It's an automatic email sent to a user's email after they completed something (say a registration). What do you guys think about this?

I've tried setting up sendmail in my Ubuntu server, but had some difficulties in setting it up. So that's why I am probably looking for more options.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You need a MTA (mail transport agent) on your machine (sendmail, postifx, ...) or you can connect to a mail provider like gmail using SMTP.

PHPMailer might be a good class for sending emails if you're not using any framework.

PHPMailer is on Google Code and GitHub.

share|improve this answer
if I am using PHPMailer do I still need an MTA? –  aherlambang Apr 13 '11 at 22:38
Yes. You need a service that connects to the external mail services and sends the messages. This can't be done using PHP properly. (Properly means that it's possible to send emails using PHP with sockets and so on, but that's really complicated and should not be used). –  Eliasdx Apr 13 '11 at 22:41
PHPMailer moved to Google Code and GitHub several years ago. –  Synchro Mar 22 '13 at 13:05
add comment

You should have a pretty easy time setting up sendmail on ubuntu

http://ubuntuforums.org/showthread.php?t=196112 This gives the basics it takes to get sendmail installed.

If you are running this server from your house or some non-datacenter there is a chance that your ISP is blocking the port numbers you need such as port 25.

Read through that thread and it should give you some good suggestions for issues you may have.

share|improve this answer
add comment

Your Answer


