When I was new to php I was sending mail using php’s basic mail() function, but later I came across phpMailer class, which can be used to send mail using any host of your choice (Gmail, for example).
This is an simple code script needed to send an mail using your host and login details.
//including phpMailer class
//creating object for phpMailer class
$mail = new PHPMailer();
$mail->SMTPAuth = true;
$mail->From = "Your Email";// example firstname.lastname@example.org
$mail->FromName = "Your Name";// example Ravi Continue reading