phpmailerHow do I set the content-type to text/html in PHPMailer?
In order to set the content-type to text/html in PHPMailer, you need to use the isHTML() method. This method takes a boolean value as a parameter, where true indicates that the content is HTML, and false indicates that the content is plain text. For example:
$mail->isHTML(true);
The output of this code is nothing, since it is a method that sets a flag.
Code explanation
$mail- An instance of PHPMailerisHTML()- Method of PHPMailer that sets the content-typetrue- Parameter passed toisHTML()to indicate that the content is HTML
Helpful links
More of Phpmailer
- How do I use PHPMailer to attach a ZIP file?
- How do I configure PHPmailer to use Zoho SMTP?
- How can I use PHPMailer to send emails through Outlook?
- How can I use PHPMailer with XAMPP on a localhost?
- How can I send a UTF-8 encoded email using PHPMailer?
- How can I set a timeout for PHPMailer SMTP?
- How can I set up PHPMailer to use Zimbra SMTP?
- How do I use PHPMailer to encode emails in UTF-8?
- How can I configure PHPMailer to work with GoDaddy?
- How can I use PHPMailer to send emails through Yandex?
See more codes...