Search code examples
phpphpmailer

PHPMailer subject with HTML msg


I need to send a email with a HTML msg on the Subject.

For the body, I use $mail->MsgHTML($someHTML); and it works fine.

But when I try to do the same with the Subject, it just interpret the whole thing as a text.

What I need is something like this:

$subject = "<img src='PATH_TO_IMG_FILE_IN_MY_SERVER'> This is the subject"
$mail->Subject = $subject;

Already tried to use the $mail->isHTML(true); but for what I read, it works only for the email's body.


Solution

  • Definitively, no. Email doesn't support HTML in the subject line, or any other header.