Send Email Using Gmail SMTP Server From PHP Script

Published: 02 September 2017
on channel: Artisans Web
4,100
10

If we have a website then we obviously need to send emails to users. That email should go through your contact us page, through your newsletter, on user registration etc.

PHP provides a mail() function which used to send an email. But there are limitations while using mail() method. You can’t send email from a local development server. Another drawback is, there is a high possibility of your email ended up in a Spam folder.

To get out of these problems, we need to use SMTP server to send emails.

In this video, we study how to use PHPMailer and Gmail SMTP server for sending emails.

We first need to install PHPMailer library in our project. The recommended way to install library is through Composer.

Open the command prompt in your project root directory and run the below command.

composer require phpmailer/phpmailer

http://artisansweb.net/send-email-usi...

~-~~-~~~-~~-~
Please watch: "How To Add Two Step Authentication On WordPress Website"
   • How To Add Two Step Authentication On...  
~-~~-~~~-~~-~


Watch video Send Email Using Gmail SMTP Server From PHP Script online without registration, duration hours minute second in high quality. This video was added by user Artisans Web 02 September 2017, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,100 once and liked it 10 people.