Change the message content type to HTML
sending mail in WordPress requires the use of the Wp_mail () function, but the default type of message content is "Text/plain", which means HTML is not supported.
If you want to add HTML code to the content of the message, in addition to sending "content-type:text/" headers information, you can also use the filter to unify the changes.
/**
*wordpress Change the message content type to HTML
*http://www.endskin.com/mail-content-type-html//
function Bing_ Set_html_content_type_html () {return
' text/html ';//Can be custom type
}
add_filter (' Wp_mail_content_type ', ' Bing_set_html_content_type_html ');
In this way, the contents of the mailbox support HTML code by default.
customizing mail and senders for messages
When you use the SMTP plug-in, you can customize the sender and mail of the message, and here's the question, how do you customize the sender and the mailbox of the message without using the SMTP plug-in?
By default, the sender is "WordPress < wordpress@example.com >" so that users cannot reply directly, and can easily be judged as spam, causing users to receive them.
If you want to modify the sender and the sender's mailbox, just use a small piece of code and put it in the functions.php (Learn more):
/**
*wordpress custom mail to send mail and sender
*http://www.endskin.com/change-mail-from-info/*/
/Send person
function Bing_wp_mail_from_name () {return
' bin fruit ';//Can be modified
by itself}
add_filter (' wp_mail_from_name ', ' bing_wp_ Mail_from_name ');
Send mail
function Bing_wp_mail_from () {return
' admin@endskin.com ';//Can be modified by itself
}
add_filter (' Wp_ Mail_from ', ' bing_wp_mail_from ');