Remove "www" from server_name in the $email_header
-
In the cfwc-form.php file, could you please check for “www” in $_SERVER[‘SERVER_NAME’] and remove it if present. This is used for “From address” in the $email_header.
For eg: if virtual host name is https://www.abc.com
the “From email address” is currently shown as “[email protected]”.
It should be, “[email protected]”.Here are the changes required.
============================
// — DEFINE HEADERS — //// $email_header = “From: =?UTF-8?B?”.base64_encode($email_sender).”?=” . ” <do_not_reply@” . $_SERVER[‘SERVER_NAME’] . “>” . “\r\n”; //
if (substr($_SERVER[‘SERVER_NAME’], 0, 4) == ‘www.’) {
$domain = substr($_SERVER[‘SERVER_NAME’], 4);
} else {
$domain = $_SERVER[‘SERVER_NAME’];
}$email_header = “From: =?UTF-8?B?”.base64_encode($email_sender).”?=” . ” <do_not_reply@”. $domain . “>” . “\r\n”;
============================
Thanks in advance,
Vijay
- The topic ‘Remove "www" from server_name in the $email_header’ is closed to new replies.