Tag Archive | "PHPmailer"


Sending emails via phpmailer

Here we configure SMTP authentication Using phpmailer. You can acquire a copy of phpmailer class from http://sourceforge.net/project/showfiles.php?group_id=26031. You should upload the file "class.phpmailer.php" to same folder for your script

IMPORTANT:  From email address and your authorization email address MUST be same.

$mail = new PHPMailer();$mail = new PHPMailer();
$mail->CharSet ="utf-8"; // You can adjust the Charset according to your language
$mail->Host = "mail.Yourdomain.com";
youremail@yourdomain.com"; //REMEMBER, this MUST be same as your authorization email address above.
$mail->FromName="PHPmailer Testing";
$mail->SMTPAuth = true;
$mail->Username = "
$mail->Password = "yourpassword";

$mail->Subject = "Test 1";
$mail->Body = "Test 1 of PHPMailer.";

   echo "Error sending: " . $mail->ErrorInfo;;
   echo "Letter is sent";

To add information about sender, use following functions:

$mail->Sender="mailer@example.com"; // indicates ReturnPath header
replies@example.com", "Replies for my site"); // indicates ReplyTo headers

For specifying various types of recepients use these:

$mail->AddAddress("mail1@domain.com", "Recepient 1");
mail1@domain.com", "Recepient 1");
mail1@domain.com", "Recepient 1");



Posted in Linux-Apache-PHPComments (0)