Skip to content

Instantly share code, notes, and snippets.

@eridesigns
Forked from bordoni/wp_mail.headers.php
Last active August 29, 2015 14:15
Show Gist options
  • Save eridesigns/b6f2a9abf40b1c98540b to your computer and use it in GitHub Desktop.
Save eridesigns/b6f2a9abf40b1c98540b to your computer and use it in GitHub Desktop.
<?php
$to = "[email protected]";
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress knowledge";
$headers = array(
'Reply-To' => "Gustavo Bordoni <[email protected]>"
);
$status = wp_mail($to, $subject, $content, $headers);
<?php
$to = "[email protected]";
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress <b>knowledge<b>";
add_filter( 'wp_mail_content_type', 'set_html_content_type' );
$status = wp_mail($to, $subject, $content);
// 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';
}
<?php
$to = array(
"Gustavo Bordoni <[email protected]>",
"WordPress Developer <[email protected]>",
"[email protected]"
);
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress knowledge";
$status = wp_mail($to, $subject, $content);
<?php
$to = "[email protected]";
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress knowledge";
$status = wp_mail($to, $subject, $content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment