Php - How to sendmail using phpmailer class, Phpmailer class

How to sendmail using phpmailer class

Download phpmailer class and use the below code to sendmail using php

 include_once 'class.phpmailer.php';

 $subject = "hi";
 $msg = "hello";
 $mail = new PHPMailer();
 $mail->IsMail();
 $mail->From = "from@example.com"
 $mail->Subject = $subject;
 $mail->AddAddress("to@example.com");
 $mail->IsHTML(true);
 $mail->Body=$msg;

 if($mail->Send()){
 echo "Sent";
 }
 else{
 echo "Not Sent";
 }

You can use the above code to send mail.

The topic on Php - How to sendmail using phpmailer class is posted by - Math

Hope you have enjoyed, Php - How to sendmail using phpmailer classThanks for your time

Tech Bluff