Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
开发者_StackOverflow Improve this questionI am running small social site. It's witten in PHP (but it is not that relevant in this case).
My plan was to make it more popular by allowing registered users to be notified about certain events happening in the site (like "someone commented your content" and so).
Currently my site is sending only simple mails (like welcome mail with confirmation link) via SMTP (Gmail). Unfortunatelly Gmail has some limits - 2000 mails per day (in paid version).
So the next step would be to use something which would allow me to send more mails than 2000 daily. There are paid services like AuthSMTP, Sendgrid, but I prefer to setup something on my own. Something which would be used for sending more than 2000 mails from "no-reply@example.com" to registered users.
So my question is: Is it good option to setup MTA (Mail Transfer Agent) to send mails from php social site? Or should I go different way?
Basically I was thinking about setting up Postfix.
First of all, e-mail is not an easy of a subject as it may seem. While running your own MTA is something you should consider, it's not always the best solution (depends on your business requirements). There's a lot of services, despite being paid ones, that will probably suffice for your needs, for now.
If you do decide that you want to run your own MTA, here's a few things you should consider:
Run Sendmail or Postfix - it's a matter of preference if you're sending a reasonable amount of email. But over 10 emails a second, go with Postfix (that's 864,000 emails per day).
If you end up running Postfix and you have multiple IP addresses available, you can setup a cronjob that changes the IP address in Postfix's configuration file and send a
SIGHUP
signal to the program. This will make Postfix start using the different IP address for sending mail and gets around a few restrictions for IP's like MSN who don't allow more thanx
emails delivered to them in a certain timespan without considering them spam.Spamassasin - Use it to scan your messages before sending them, if for some reason your server is infected with a spam spreading virus, you'll be thankful you have it (instead of then begging the blacklists to remove you).
Sign up for whitelist programs or delivery tracking programs with various IPS's, such as Microsoft's Postmaster.
Keep an eye on blacklists and ensure that your IP(s) are not listed on them. There are a lot of them but monitoring the major ones should suffice.
You'll need to properly setup reverse DNS and possibly some SPF records if you want to send mail on behalf of another domain or subdomain.
Use a good PHP library for sending mail, such as SwiftMailer or any other of your preference.
Hope this helps!
EDIT:
Now that you mention it in the comments, also please read, very carefully: 2003 CAN-SPAM Act
精彩评论