Articles of html email

how to set from address according to the form input email address for wp_mail()?

I am trying to create form and send it to my e-mail address using wp_mail. my wp_mail() code is: if($_POST[“submit”]) { $to=”my email”; $subject =”My subject”; $sender=$_POST[“sendername”]; $senderEmail=$_POST[“senderEmail”]; $message=$_POST[“message”]; $name_title=$_POST[“name_title”]; $mailBody = “<b><span style=’color: red;’>Name:</span></b> $name_title $sender\n<br/> <b>Email:</span></b> $senderEmail\n\n<br/><br/> <b>Message:</b> $message”; $mail_sent = wp_mail( $to, $subject, $mailBody ); } and for changing the from address […]

Include HTML template file in wp mail

I’m using wp mail to send an html email. But there’s quite a lot of html code in the email, so rather than including all the code in my wp mail function, is it possible to have the code in a separate template and just include this template in the function? Here is what I […]

Using wordpress templating for html emails

Im working on a plugin that needs to send out an email after a form submission. Im using wp_mail for this, and it works perfectly fine. My problem is that in my code the html is generated by a bunch of php string being added to a variable like so: $content = $html_headers; $content .= […]

Mail will not send in HTML

Okay, I’ve got the following issue. I’m trying to send a mail in HTML format. I made a class that returns an HTML string, and that works great. When I pass that html-mail as $message in my function, works also. But it will not send as html, but plain text. Now I’ve tried the following […]

Is there a way to send HTML formatted emails with WordPress' wp_mail function?

Is there an action_hook or something similar that could help me achieve this? I tried adding markup in a PHP string variable and just fired off an email with the wp_mail function like so: $email_to = ‘’; $email_subject = ‘Email subject’; $email_body = “<html><body><h1>Hello World!</h1></body></html>”; $send_mail = wp_mail($email_to, $email_subject, $email_body); But it showed up as […]