PHPMailer\PHPMailer\PHPMailer::msgHTML
Create a message body from an HTML string.
Automatically inlines images and creates a plain-text version by converting the HTML, overwriting any existing values in Body and AltBody. Do not source $message content from user input! $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty will look for an image file in $basedir/images/a.png and convert it to inline. If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) Converts data-uri images into embedded attachments. If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
Signature
public function msgHTML(string
$message,
[string
$basedir = '',
[boolean
$advanced = false]] )
Parameters
$message
— string- HTML message string
$basedir
— string- Absolute path to a base directory to prepend to relative paths to images
$advanced
— boolean- Whether to use the internal HTML to text converter
or your own custom converter @see PHPMailer::html2text()
Returns
- string
- $message The transformed message Body