© 2024 fjorge. All rights reserved.
How to Send an Email using PHPmailer and Gmail for SMTP

I needed to offer a client the ability to send Email using PHPmailer and Gmail. The below is what I came up with, which worked flawlessly:
The part that threw me for a loop was right here:
I was using simply smtp.gmail.com. I knew from setting up mail clients that you needed to use SSL, but it didn't occur to me to tell PHPmailer to do the same. When it came to me, simply looking up how to instruct PHPmailer to use SSL did the trick.