Avatar of APD Toronto
APD Toronto
Flag for Canada asked on

PHP SMTP authentication

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)
PHP

Avatar of undefined
Last Comment
APD Toronto

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
gr8gonzo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gr8gonzo

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 Toronto

ASKER
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 Baldwin

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61
APD Toronto

ASKER
Thank you guys.