In Godaddy shared hosting . i am using PHPMailer to send HTML formatted mails, Mail is delivered but in html code not the html formatted mails .
$template = file_get_contents('otpmailcontent.txt', FILE_USE_INCLUDE_PATH);
$template = str_replace("###fullname###",$fullname,$template);
$template = str_replace("###otpcode###",$otp,$template);
$email=$toemail;//change email to receipents email
$mail = new PHPMailer();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = false;//SMTP authentication should be false
$mail->SMTPSecure = 'none';// Security type should be none
$mail->Host = 'localhost';// SMTP host name should be localhost
$mail->Port = 25;
$mail->setFrom('[email protected]', 'Signup OTP'); //Set who the message is to be sent from
$mail->addReplyTo('[email protected]', 'Signup OTP'); //Set an alternative reply-to address
$mail->addAddress($email); // Add a recipient
$mail->WordWrap = 50; // Set word wrap to 50 characters
// Set email format to HTML
$mail->Subject = 'Signup-OTP';
$mail->isHTML(true);
$mail->Body = $template ;
$mail->AltBody = $body;
if(!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
echo 'Email Has not Sent';
exit;
}
else{
echo "email sent";
}
}
I have made all the changes, Nothing is working .
Could any experts help would be grealy appreciated.
Thanks
Martin.