PHP Script for Sending Email using Gmail SMTP
Send email from the script is the most used functionality in the web application. Basically, PHP mail() function is used to send email from the PHP script. When you sending an email using the mail() function in PHP, the mail is sent from your web server. Sometimes it may cause issues on sending an email and fails to deliver mail to the recipient. With SMTP you can overcome this issue.