How to send emails using PHPmailer and GMAIL SMTP

Here I have tried how to send PHPMailer with attachment using SMTP configuration. For SMTP Configuration we here used GMAIL Auth. You can be used any Auth like SMTP2GO, SendGrid.

Download PHPMailer library.

PHPMailer Sample Code

Copy paste the following code in your editor and save with any filename with extension “.php” and try in your live server or local server. But Make sure you have to connect with internet with proper Auth details

 

Leave a Reply