I set up an emailform in PHP and send it through WORDPRESS. I thought I had everything covered but apparently it keeps displaying WORDPRESS
as the sender instead of the email I have configured.
I have added my code below, but I guess I'm missing the §from_name
field when I send the email? I Googled for wp_mail()
problems with the sender, but couldn't find/understand anything.
$from_name = "MyWebsite";
$from_email = "info@website.com";
$admin_email = "[receiver email]";
$admin_email_subject = "A new message has been sent from MyWebsite!";
$email_styles = "font-family:Verdana; font-size:11px;";
$admin_email_message = <<<ADMIN_EMAIL ...[CONTENT]...ADMIN_EMAIL;
$admin_email_message = str_replace($find_these, $replace_these, $admin_email_message);
$admin_email_message = '<div style="' . $email_styles . '">' . str_replace("\n","<br/>",$admin_email_message) . '</div>';
add_filter( 'wp_mail_content_type', 'set_html_content_type' );
wp_mail($admin_email,$admin_email_subject,$admin_email_message . $fields_string);