I am using PHP mailer to send an online form directly to email. I want to edit the form like this:
$message = '<p>The following request was sent from: '</p>;
$message .= '<p>Name: '.$name.'</p><br />';
$message .= '<p>Phone: '.$phone.'</p><br />';
$message .= '<p>Email: '.$email.'</p><br />';
However, in the email I receive back, I get the <p>
, <br />
, etc. Not the formatting I want, but the actual HTML. It has always worked for me, then I realized I was using the stock PHP mail function. not sure if PHP mailer has different parameters OR if I just missing small here?
Where would I set the headers for text/html?
$mail = new PHPMailer();
$mail -> IsSMTP();
$mail -> Host = "---";
$mail -> Port = 25;
$mail -> SMTPAuth = false;
$mail -> Username = EMAIL_USER;
$mail -> Password = EMAIL_PASS;
$mail -> FromName = $from_name;
$mail -> From = $from;
$mail -> Subject = $subject;
$mail -> Body = $message;
$mail -> AddAddress("---");
$result = $mail -> Send();