Question:
SMTP Authentication with PHP?
munch munch
2008-04-01 17:11:39 UTC
I am building a PHP web application and I need to be able to send emails from my website. The webhost that I'm using (Dreamhost) requires SMTP authentication to send emails, so I can't use the standard mail() function. I was looking at the PEAR package a little bit, but wouldn't that need to be installed on my webhost's server to be used? Is there a relatively simple solution that doesn't require installing entire packages and programs to get the job done?
Four answers:
2008-04-01 17:35:11 UTC
It's odd that you're getting that message. I use Dreamhost as well and use the standard mail() function on several sites without authentication or error.



EDIT: Added the link to the Dreamhost wiki on php mail(). Doesn't mention anything about requiring authentication and saw many posts on the Dreamhost forum saying the same.
PAULSC
2008-04-01 17:22:24 UTC
I'm surprised Dreamhost would require Web host customers to do SMTP authentication in their Web applications; this is a function handled much better by the Dreamhost SMTP servers themselves, which can work from a dedicated DNS cache, and locally cached blacklists/whitelists or . That's easier for you, the Web hosting customer, and a lot more efficient for them, in terms of bandwidth and running block lists.



Are you sure they are telling you, that you have to do the authentication, or just informing you that if you use their SMTP servers, your outgoing mail addresses must authenticate to be sent?



Edit:



OK, I see from the following that they are wanting your account name/password to authenticate to their SMTP servers to send. You can just script that as part of a custom mail function you call, formatting messages to and from their SMTP hosts. The second link below has example php code using PEAR that does that. PEAR is available on Dreamhost servers, according to the (unofficial) third link, at least through PHP5.
dietrick
2016-12-14 20:21:49 UTC
I fairly have the comparable undertaking and that i study the countless answer. it could have labored for them. inspite of the common actuality that, i'm having that undertaking on my Palm TX and can't run any optimizer application. If I fairly have a application undertaking the only recourse is it a million)delete this technique and take a examine out reinstalling it ( and that i've got have been given 2 mail customers on my PDA having the comparable undertaking so I assemble it isn't the appliance OR 2)the scary answer must be to reset the device decrease returned to that's orignial production unit project and having to reinstall application over decrease returned and fix decrease returned up data. no remember whether that's a checklist undertaking then I run the opportunity of copying decrease returned into the device a corrupt checklist (i do no longer think of that it is the case.) i've got have been given no problems with the countless 2 mail charges on the PDA (AOL and Embarq). i think of of it is actual a YAHOO undertaking and must be addressed immediately away via YAHOO. want this helps narrow the parameters for discovering a answer.
NC
2008-04-02 10:33:44 UTC
SMTP authentication isn't exactly the simplest thing in the world to accomplish, so you may be better off integrating a third-party package. While PEAR may be an overkill, you might want to take a look at phpMailer instead:



http://phpmailer.sf.net/



__________


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...