phpmailer Print

  • 1

We require smtp authorization to send email on our windows standard server.

To send email from php you may use phpMailer. You may download it from http://www.hosticon.com/client/downloads.php

You should extract archive and put all files from directory Upload in the same directory as your script.
Next you should use following code to send email instead of mail() function.


require("class.phpmailer.php");
$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Host = "MAIL.DOMAIN.COM";
$mail->SMTPAuth = true;
$mail->Username = "POP3ACCOUNT.NAME";
$mail->Password = "POP3.PASSWORD";

$mail->From = "POP3ACCOUNT.NAME";
//$mail->FromName = "Mailer";//optional from name
$mail->AddAddress("RECIPIENT", "RECIPIENT'S NAME");
//$mail->AddReplyTo("sender@example.com", "Information");
$mail->IsHTML(false); // set email format to HTML

$mail->Subject = "SUBJECT";
$mail->Body = "BODY";
if(!$mail->Send()) {
echo "Message could not be sent.
";
echo "Mailer Error: " . $mail->ErrorInfo;
}


Was this answer helpful?

« Back
© HostIcon. All rights reserved. Logo and name is a registered trademark of Space Technologies.