<?php
$msgtocustomer = "";
$msgtocustomer .= "your_message";
$headers = [
'From: Ananta Raj Khanal <noreply@example.com>',
'X-Mailer: PHP/' . phpversion(),
'MIME-Version: 1.0',
'X-Priority: 3',
'Content-type: text/html; charset=utf-8'
];
$headers = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $chkEmail, "New Mail", $msgtocustomer, $headers );
?>This code is an example of sending an email using the wp_mail() function in WordPress.
The $msgtocustomer variable contains the message that is going to be sent in the email.
The $headers variable contains an array of headers, including the From header, X-Mailer header, MIME-Version header, X-Priority header, and Content-type header. The Content-type header is set to text/html, which means that the email message will be sent as HTML.
The wp_mail() function takes four arguments: the recipient email address, the subject of the email, the message to be sent, and the headers array.
So, when this code is executed, it will send an email with the message in the $msgtocustomer variable to the email address specified in the $chkEmail variable, using the headers specified in the $headers variable. The subject of the email will be “New Mail”.





