We help IT Professionals succeed at work.

PHP SMTP authentication

APD Toronto
APD Toronto asked
on
203 Views
Last Modified: 2017-04-07
Hello Experts.

What is the easiest way to send email through PHP with SMTP authentication? Is it PEAR?

BONUS: Would I be able to use it from my localhost, where I don't have a Mail server. (not mandatory)
Comment
Watch Question

Fixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
gr8gonzoConsultant
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
gr8gonzoConsultant
CERTIFIED EXPERT

Commented:
Also, for what it's worth, -all- SMTP clients work in the same manner, in that they run from your local computer and connect to a mail server (either remote or local), and tell the mail server about the message you want to send. Outlook, Thunderbird, PHPMailer, Swiftmailer, etc...

Just keep email delivery rules in mind (SPF, etc) so you don't accidentally get flagged as a spammer.
APD TorontoSoftware Developer

Author

Commented:
Could I get a sample script of PHP Mailer that uses a password? As well, is it safe if I have a contact form that asks for a email address to use that as the sent from so the replier can just hit "Reply"?
Dave BaldwinFixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
Yes, PHPMailer comes with samples, just download it.  Entering an email address to use as the From may not work so well.  The 'From' address is usually part of the authentication along with the password for that account.  Remember, these programs are not mail servers, they are methods to use mail servers instead of using the PHP mail() command.
APD TorontoSoftware Developer

Author

Commented:
Thank you guys.