Skip to content

Instantly share code, notes, and snippets.

@eto4detak
Created November 30, 2018 21:49
Show Gist options
  • Save eto4detak/2853420dad208e0a30d312f399832976 to your computer and use it in GitHub Desktop.
Save eto4detak/2853420dad208e0a30d312f399832976 to your computer and use it in GitHub Desktop.
wp php email
<?php
function sendEmail($fromEmail,$fromEmailName,$toEmail,$toEmailName,$subject,$message,$extra='') {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'To: '.$toEmailName.' <'.$toEmail.'>' . "\r\n";
$headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>' . "\r\n";
if(wp_mail($toEmail,$subject,$message,$headers)) {
}else {
@mail($toEmail,$subject,$message,$headers);
}
}
sendEmail(get_bloginfo("admin_email"),get_bloginfo('name'),'[email protected]',get_bloginfo('name'),__("Question report","vbegy"),'ee dfsd dfs f sd ff');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment