PHP has default mail() function for sending mail. We can easily send mail using this function passing few parameters. But there is one nice class named ‘PHPMailer’ extending that function with lots of attractive and useful features. This PHPMailer, PHP email transport class features file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), QMail, or with SMTP.
Here is an simple example to use PHPMailer.
$objMail = new PHPMailer;
$objMail->IsHTML(true);
$objMail->From='sender@gmail.com';
$objMail->FromName='Sender Name';
$objMail->AddEmbeddedImage("logo.jpg", 1, 'logo.jpg');
$objMail->Subject='Mail sent using PHPMailer';
$objMail->AddAddress('receiver@gmail.com', 'Receiver Name');
$objMail->AddAttachment('attachment.docx');
$objMail->Body='This is mail body';
$objMail->Send();
You can find detail documentation here.
There are some interesting points in time in this article but I don’t know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article , thanks and we want more!
Marvelous, what a weblog it is! This web site gives
helpful facts to us, keep it up.