Any reasons not to use mail function?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Any reasons not to use mail function?

Post by GeXus »

Are there any reasons why not to use php's mail function? as far as deliverability goes... how does it stack up to other classes you may find or commercial software?
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

Well, it's a matter of opinion.

If you're unfamiliar with any specific classes, and you just want to send a simple email, use mail(). If mail() gives you problems, you're probably better off finding a good class (SwiftMailer *cough*) and implementing it rather than trying to solve the problem with mail(), as it's not extensively configurable.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The headers alone are a minefield of settings. One misplaced can easily kill your email from reaching certain servers. I would say that if you are unfamiliar with the quirks of the various receiving servers or unfamiliar with the correct headers or need to send anything more than a plain-text email, use a package. There are several free (as in beer) solutions out there that have been tested fairly thoroughly and are often referred to as tools to hold onto. On DevNet, Swift is probably the most recommended, as one of our own (moderators) made it. Another frequently referenced is phpMailer.
Post Reply