How to send Emails From PHP using PHPMailer

PHP email transport class featuring file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), QMail, or with SMTP.

phpmailer_v21download or download it from

put these files in you website root and run the below code to send E mails.

1. class.phpmailer.php

2. class.pop3.php

3. class.smtp.php
$mail = new phpmailer();
$mail->From     = “”; //from Email Id
$mail->FromName = “yourname”;  // from name
$mail->Host     = “;”; // your websites mail
$mail->Mailer   = “smtp”;

// HTML body
$body  = “Hello <font size=\”4\”>arun</font>, <p>”;
$body .= “<i>Your</i> personal photograph to this message.<p>”;
$body .= “Sincerely, <br>”;
$body .= “phpmailer List manager”;

// Plain text body (for mail clients that cannot read HTML)
$text_body  = “Hello ” . “, \n\n”;
$text_body .= “Your personal photograph to this message.\n\n”;
$text_body .= “Sincerely, \n”;
$text_body .= “phpmailer List manager”;

$mail->Body    = $body;
$mail->AltBody = $text_body;
$mail->AddAddress(‘’,’Arun Raj R’);
$mail->AddStringAttachment(“file”, “YourPhoto.jpg”);

echo “There has been a mail error sending to <br>”;

// Clear all addresses and attachments for next loop



me : yeay its me arun

Tagged with: , , , , , , ,
2 comments on “How to send Emails From PHP using PHPMailer
  1. superlolek says:

    and that’s what tigers like 😀

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.