tags:

views:

91

answers:

1

I will have to send mails from a php website via smtp. The smtp server is at a different hoster.

Mails will only be sent and not received. Sending multipart emails (atachments, simple HTML) should be supported.

The site will send for reasons like registration confirmation, ticket creation, contact form, newsletter registration, mass mailing all users (only some hundreds).

1) Can you reccomend from your experience a good mailing class. Should be robust, object oriented, few dependencies, future proof, free and open source. Can you name some advantages of the library or class you recommend or maybe compare them if you know several?

2) How could I handle errors ...

a) ... if the smtp server is not reachable. How would I handle a timeout (the page should deliver fast or at least show the user some message?) Would it be a good solution to send the email after the page was delivered and how wold this be done nicely in php5?

b) ... if the smtp server reports an error and rejects the message for some unpredicted reason?

Edit: 3) From VolkerK's answer I learned that it is important that generated mail is well-formed and fulfills certain requirements. It is a top priority for me that the mails are not held back by too many systems as "false positive". Swiftmailer seems to take care for this, what about the others?

4) What else can you add as a recommendation?

+2  A: 

I recommend SwiftMailer.

For your mass mailing you might especially be interested in the decorator plugin and the How to (legitimately) minimize being seen as spam tips.

VolkerK
thank you, i did not know this one, i am browsing the source at github now.