Skip to content

Instantly share code, notes, and snippets.

@wisecrab
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save wisecrab/cb021849eeff0efe5d13 to your computer and use it in GitHub Desktop.

Select an option

Save wisecrab/cb021849eeff0efe5d13 to your computer and use it in GitHub Desktop.
A simple function and variable set group to send an email from WordPress.
$to = 'email@example.com';
$subject = 'This is the email subject';
$message = 'Here is my email message.';
$headers = 'From: My Name <myname@example.com>' . "\r\n";
$headers .= "Reply-To: myname@example.com \r\n";
$attachments = '';
wp_mail( $to, $subject, $message, $headers, $attachments );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment