Hello to all, welcome to therichpost.com. In this post, I will show you, Send Email in WordPress working example.
If you are new in WordPress, then you can check my old WordPress post and WordPress tricks to get some knowledge of WordPress.
I personally like wordpress very much and I do my mostly work in WordPress.
Here is the working code for Send Email in WordPress working example and please follow it carefully:
<?php //Mail Function $to = 'YourEmailId.com'; $subject = "Wordpress Test Email"; $headers = 'Content-type: text/html;charset=utf-8' . "\r\n".'From: '. $_POST['request_email'] . "\r\n" . 'Reply-To: ' . $_POST['request_email'] . "\r\n"; $message = "Name = ".$_POST['request_name']; $message .= "<br />Phone =".$_POST['request_phone']; $message .= "<br />Email =".$_POST['request_email']; $message .= "<br />Comment =".$_POST['request_comment']; //Here put your Validation and send mail $sent = wp_mail($to, $subject, $message, $headers); if($sent) { echo "Mail Sent"; } else { echo "Mail did not send"; } ?>
If you have any query related to this post then please do comment below.
Harjas,
Thank you
Recent Comments