i cant send email using the php mailer class. here is the error i am getting.
Error
Mailer Error: The following From address failed: [email protected] : Called Mail() without being connected.
here is the code i am using.
$mail = new PHPMailer();
$mail->IsSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.live.com'; // Specify main and backup server
$mail->Port = '465';
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'sdf'; // SMTP password
$mail->SetFrom($from, $from);
$mail->AddReplyTo($from, $from);
$mail->Subject = $subject;
$mail->MsgHTML($message);
$address = $to;
$mail->AddAddress($address, $customer_name);
if (!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
else
{
echo "Message sent!";
exit;
}