通过PHP发送电子邮件的选项

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.

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.

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.