PHP mailer class is not working in windows server [duplicate]

This question already has an answer here:

I hosted My website on windows server 8 wamp server.And i am using phpmailer class for sending email through the website.But email is not sending from server.
Here is the code I’m using

<?php
include_once('PHPMailer/class.phpmailer.php');

$objCommon      = new common();
$objSettings    = new settings();
$objContactUs   = new contact_us();
$mail           = new PHPMailer();
$body = 'body of the mail';//email body here

$mail->CharSet = 'UTF-8';
$mail->AddReplyTo($email,$name);
$mail->SetFrom($email,$name);
$address = 'test@test.com';//email to;
$mail->AddAddress($address,"");

$mail->Subject    = "subject"; 

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);
$mail->Send();
?>

This code is perfectly working in linux server, but my client have windows server 8 and wamb. I think I’m missing something in server side section


Source: wampserver

Leave a Reply