/    Sign up×
Community /Pin to ProfileBookmark

mail() SMTP, SPAM and other stuff

Hi All,

I’ve been looking at adding newsletter emailing to our site, and I am completely, totally confused by opposing opinions. I therefore turn to you all for advice on the following…

[B]Is SMTP better than php mail()?[/B]
It seems opinion is evenly divided here. Some say “must use SMTP”, while others say “only use SMTP in your server doesn’t allow mail()”. Which is it?

[B]Is SMTP faster or slower than mail()? [/B]
I currently use an extremely simple SMTP function that works fabulously. The php documentation says mail() opens and closes a socket for each mail sent, making it slower and consuming resources… but SMTP does the same. Why would one be different to the other?

[B]Is SMTP more efficient for bulk mailings?[/B]
It seems to me that I still have to loop through each recipient because I’ve read that hotmail (and others) think if the recipient address isn’t in the mail header, the mail is SPAM, therefore ruling out the use of BCC.

Note that sending too many emails at a time isn’t an issue… I already put the contents of the email and the address details into a data file and cron will send them 30 (or 40 or whatever) at a time until they’re all gone, deleting the record as it goes.

I did read somewhere that the reason mail() looks slower is that when it dumps the mail in the sendmail queue, it waits for confirmation that it’s been sent, and that there’s a flag you can send with mail() (or maybe it’s a configuration setting) that simply dumps the email there and moves on, without waiting. Is that correct, and if so, how do I flag/set it?

Any thoughts on all of this because, as I said, right now, I’m confused to the point of paralysis.

Cheers
CTB

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 08.2010 — You might want to look at the PEAR::Mail package (pear.php.net) which includes interfaces for both sendmail and SMTP (in addition to the standard PHP mail() function), either of which should be more efficient than using the mail() function for large quantities. You could use it in conjunction with the PEAR::MailQueue package to help organize the bulk emailing process.
Copy linkTweet thisAlerts:
@chestertbauthorJan 08.2010 — Thanks NogDog. I took a look at those, and especially MailQueue, but is appears to do exactly what I already do... which is that it saves the mail in a db and sends it later.

(And as you know, I'm not smart enough to quickly figure out how to interface it all. Can't recommend a quick, easy-to-follow tutorial can you?)
Copy linkTweet thisAlerts:
@NogDogJan 08.2010 — Nope. :p

Last bulk email job I did for anyone was a couple years ago, and we ended up implementing poMMo, and I didn't really have to do any "down in the weeds" stuff with the actual email functions.
×

Success!

Help @chestertb spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...