Google App Engine
Maybe you could try out Google app engine's email service(It is not a PHP solution, but this scales really well and is cheap). You can email 2,000 recipients(8 recipients/minute) daily for free. After that you only have to pay $0.0001 per recipient (5,100 recipients/minute). I think this is really cheap and it works really well.
Email service
I developed a real simple mail service. You just simply curl(post data) to your app engine domain.
Quick introduction to google app engine
If you are interested in this solution here is a quick video introduction by Brett Stalkin explaining how to creat a simple guestbook using python's app engine sdk within 10 minutes. I think this is pretty amazing.
Code
app.yaml
application: nameofmyapplication #name of your application
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: myemail.py
myemail.py
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import mail
#config
sender = "[email protected]" # Your admin email adres.
secret = "/7befe053cf52caba05ad2be3c25c340af7732564" # needs leading /
class Email:
@classmethod
def email(self, to, subject, body):
message = mail.EmailMessage()
message.sender = sender
message.subject = subject
message.to = to
message.body = body
message.send()
class MainPage(webapp.RequestHandler):
def post(self):
if not sender:
self.response.out.write("Please configure sender.")
pass
to = self.request.get("to")
subject = self.request.get("subject")
body = self.request.get("body")
if not mail.is_email_valid(to):
self.response.out.write("to param is invalid email address.")
pass
if not subject:
self.response.out.write("subject param is invalid.")
pass
if not body:
self.response.out.write("body param is invalid")
pass
Email.email(to, subject, body)
self.response.out.write("Message sent.")
application = webapp.WSGIApplication(
[(secret, MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
Configure application
For example you have the following configuration.
app.yaml
- application:
nameofmyapplication # name of your application
myemail.py
- sender: To your admin email address specified for app engine. For example
[email protected]
- secret: To secret url which to post data to. For example:
7befe053cf52caba05ad2be3c25c340af7732564
Uploading application to app engine
- Put all the code in a directory
<path to your folder>
.
- Upload the code using
appcfg.py update <path to your folder>
- If successful you can access your app online.
Sending email using curl
The final step to test your app.
curl -d "to=<[email protected]>&body=<Hello World!>&subject=<Testing app engine>" http://<nameofyourapplication>.appspot.com/<7befe053cf52caba05ad2be3c25c340af7732564>
Where arguments between <>
you have to specify yourself, off course omitting the <>
.If successful the server should response with Message sent.