As you may know, it is simply to send mails with the PHP mail() function. So why use PHPMailer? Isn't it slower? Yes that's true, but PHPMailer makes it easy to send e-mail, makes it possible to attachm files, send HTML e-mail, etc. With PHPMailer you can even use your own SNTP server and avoid Sendmail routines used by the mail() function on *nix platforms. [Ref. http://phpmailer.codeworxtech.com ]
require ( "class.phpmailer.php" );
$mail = new PHPMailer();
$mail ->IsSMTP(); // telling the class to use SMTP
$mail ->Host = "smtp.example.com" ; // SMTP server
$mail ->From = "from@example.com" ;
$mail ->AddAddress( "myfriend@example.net" );
$mail ->Subject = "First PHPMailer Message" ;
$mail ->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer." ;
$mail ->WordWrap = 50;
if (! $mail ->Send()) {
echo 'Message was not sent.' ;
echo 'Mailer error: ' . $mail ->ErrorInfo;
} else {
echo 'Message has been sent.' ;
class.phpmailer.php is this an inbuilt class in PHP or we have to download it separately.
ReplyDeleteThis is an third party tool hosted in SF. You can download it in - http://sourceforge.net/project/showfiles.php?group_id=26031
ReplyDelete