How can I format email notification after registration?

wp_mail from Codex Use this example: add_filter( ‘wp_mail_content_type’, ‘set_html_content_type’ ); wp_mail( $mails_to, ‘The subject’, ‘<p>The <em>HTML</em> message</p>’ ); // Reset content-type to avoid conflicts — http://core.trac.wordpress.org/ticket/23578 remove_filter( ‘wp_mail_content_type’, ‘set_html_content_type’ ); function set_html_content_type() { return ‘text/html’; }

Create mail form using PHPmailer

I suggest you first of all to separate code from markup, especially dividing your executing file like the function support_form(). Next, please try to send email without form with hard coded message. It is possible you have mis-configuration on your server if you developing on local machine. And finally, you should fill action attribute for … Read more

wp_mail not sending email on custom function

The way you’re applying the headers is incorrect. You set a “from” address in the headers as a string, and then you immediately overwrite that with an array (so the “from” address is lost). (You’re also setting the $from address twice) Try it this way: function send_email(){ $to = $email; $subject = “Lamza Activation”; $activationEmail=””; … Read more

How dynamically change wp_mail behaviour, sending html or plain text based on conditions?

Here’s an (untested) PHPMailer example to check for e.g. the subject and the content type: function mailer_config( PHPMailer $mailer ) { if( ‘Subject #1’ === $mailer->Subject && ‘text/html’ !== $mailer->ContentType ) { $mailer->IsHTML( true ); } } other options would be to e.g. check the $mailer->From or $mailer->FromName, or some other conditions, depending on your … Read more

wp_mail not sending emails

After fiddling around for hours, I found the problem. It was the form not the PHP. <div class=”col-sm-6″> <input class=”form-control” type=”text” placeholder=”ENTER DOG’S NAME” id=”dname” /></div> <div class=”col-sm-6″> <input class=”form-control” type=”text” placeholder=”ENTER OWNER’S NAME” id=”name” /></div> id attribute needs to be name. Corrected <div class=”col-sm-6″> <input class=”form-control” type=”text” placeholder=”ENTER DOG’S NAME” name=”dname” /></div> <div class=”col-sm-6″> … Read more