Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

PHPMailer All Feature

php PHPMailer
PHPMailer All Feature

In this article we have talk about why you should use PHPMailer instead of PHP mail() function and we have show some code samples on how to use this library.

PHPMailer is one of the most popular open source PHP libraries to send emails.

Although it was released in early 2000s, it is now a very commonly adopted approach among developers for sending emails in PHP. You may also like How to send mail in PHP using PHPMailer and How to send attachment mail in PHP using PHPMailer.

Download PHPMailer Library.

PHP Code using PHPMailer with all Feature


$mail  = new PHPMailer(); 

$mail->Host = "";  /*SMTP server*/

$mail->SMTPAuth = true;

$mail->Port = '';
$mail->Username = "";  /*Username*/
$mail->Password = "";    /**Password**/

$address = "";

$mail->SetFrom('', 'demo');

$mail->AddAddress($address, "Demo");
$mail->Subject    = "PHPMailer Test sEND MAIL";
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
$body  = "Mail body in HTML";
	echo "Mailer Error: " . $mail->ErrorInfo;
	echo "Message sent!";


Html code work in comment box

Related Post