The default content type is 'text/plain'
which does not allow using HTML. You can set the content type of the email by including a header like “Content-type: text/html”
$headers="Content-type: text/html;charset=utf-8" . "\r\n";
$headers .= 'From: XXXXXX.com <[email protected]>' . "\r\n";
$subject="Registration from xxxxx.com" . "\r\n";
$message = $result_email_text;
wp_mail($_POST['admin_email'], $subject, $message, $headers );
Or you can set it by using the wp_mail_content_type
filter
remove_filter( 'wp_mail_content_type', 'set_html_content_type' );
add_filter( 'wp_mail_content_type', 'set_html_content_type' );
function set_html_content_type() {
return 'text/html';
}
For more detail see the following link:
http://codex.wordpress.org/Function_Reference/wp_mail
Related Posts:
- Email sent from WordPress has HTML tags
- Sending multipart (text/html) emails via wp_mail() will likely get your domain banned
- How to set SMTP programmatically
- Do something after sending email
- Include HTML template file in wp_mail
- Reset Password – change from name and email address
- Few chars getting replaced with ‘=’ in mail content in wp_mail()
- wp_mail recipient array not sending?
- On form submission how to send 2 email to different users
- How to Configure SMTP on wordpress Cant Send Email
- How to add line breaks to $email[‘body’] when using auto_core_update_email hook
- Joining confirmation email
- How to setup SMTP for only one specific wp_mail()
- Must I change the admin user email address while changing the general email address?
- User invite email not delivered – related to subdomain?
- Can I configure WordPress to use postfix without a plugin?
- Email ‘from address’ has a www in it
- Trigger WordPress Actions from Email?
- PHP mail() works but wp_mail() does not
- WP mail sent to MS Exchange recipients = occasional email corruption?
- WordPress unable to send mail
- Not able to send links in email after setting header
- Emailing passwords: Setup installed on home server using XAMPP
- Mail function is not working
- Send bulk emails without timeout
- What is the best way to send out thousands of emails from a WordPress site? [closed]
- Change the Sender(not From) on wp_mail() function [closed]
- Prevent sending emails on user creation in OOP context?
- WordPress get_the_content losing formatting when emailed
- WordPress email could not be sent
- Send email daily using `wp_mail`
- wp_mail() won’t send mail when it’s a variable, only when hard coded
- Send email for confirmation during user registration
- Images in wp_mail not showing
- wp_mail send multiple emails in a loop
- Can’t change headers / From for wp_mail()
- How can I remove the product short description from the WooCommerce Mails?
- New user notification issue
- Why do WordPress emails to multiple recipients include \n in the list
- wp_mail() not sending emails with ajax
- wordpress wp mail not changing sender mail
- Whitelist email sent by WordPress
- WP Mail isn’t sending user account messages, does send from plugins
- Asynchronous emailing
- Send email from WordPress
- changing notification emails from WordPress @mydomain.net to something else
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- Alert Email when any Post or Page is Changed
- Missing URL in password reset email
- prevent users from changing their email address
- wp_mail and BCC headers
- Allow Duplicate Email Address for Different Users
- How do I override the Message-ID header of wp_mail function?
- WP Cron emails not working
- Locked out of my own blog and password reset not working
- Change Password notification text on mail
- email sends from [email protected] even though I have it set to something else
- Email notification after registration in WordPress
- Processing a subscription form with POST method?
- WordPress E-mail Config
- wp_mail not sending attachment
- wordpress do not let user registered with info@ email and other reserved emails to get registered by users
- Limit number of emails per second
- Throttling email frequency
- Multisite not using subdomains as hostname in from address when sending emails
- How to retrieve the sender email with wp_mail()?
- wp_mail 200 response but no mail sent
- wp_mail_from is ignored
- PAGE Specific Email Notifications
- How to edit the WordPress e-mail that gives the user their password? [duplicate]
- Do action for only switch status for publish_post
- Attach pdf from dynamic url
- Adding “reply-to” in the email [closed]
- Programming WordPress to Send an Email on Registration Form Submit?
- How do I troubleshoot registration/password email errors?
- Does WordPress require port 25 for email?
- Is there a plugin that will let you do actions by mail? [closed]
- Error using wp_mail inside custom function
- How to send confirmation email after payment made via paypal?
- Changing email “From” address
- WordPress and IPN problem
- Add “Email Image” button with Hyperlink for individual images [closed]
- Mail through Cron Execution does not work!
- Need to suspend RSS feed while repairing missing old post
- Activation email to change admin address not being sent to Gsuite email account
- Send email with Content-Type text/plain
- forgot password page with expiry link email of 60 minutes
- I need to verify emails when users signup
- Where is the account email address located?
- SMTP not working for Comments Email Notifications
- changing notification emails from WordPress @mydomain.net to something else
- Send Bulk Email without them going to spam
- How can I send an email 24 hours after first email?
- WordPress doesn’t send SMTP email even by phpmailer hook
- Duplicate notifications for new user registration
- send email to all registered users when post expires
- get_post_meta is always empty when I use wp_mail
- Choose from different emails for different purposes
- WordPress wp_mail not working on a few pages
- Admin email value stuck in database?