The Big Spring Sale! Up to 50% off!

PHP form sets "from" to "send to"

iveta.halanova2
5 Posts
iveta.halanova2 posted this 12 October 2020
Report a bug

Hello,
I have an issue with PHP form and how it sets email headers.
I would expect "where to send the email" would be just used where submission should be sent. But it asigns it to field "from".
There there's field "from" and when I leave it empty, it fills it up with email submitted in the form. But when I fill it up, then it sets it to "reply-to". It doesn't make sense.

private function _getEmailHeaders($toEmail, $formEmail) {
        $headers = 'From: ' . $toEmail . PHP_EOL;
        $headers .= 'Reply-To: ' . $formEmail . PHP_EOL;
        $headers .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
        $headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL;
        return $headers;
    }

Let say:
I want submission to be sent to: emailA
I want to see it's sent from: emailB
And reply-to is set to: emailC (submitted by user)

I receive submission in emailA, but instead it's set:
sent from: emailA (should be emailB)
reply-to: emailB (should be emailC)
And emailC is just in the text of email I get.

If I leave field "from" empty, it correctly fills it with emailC, but I still want it to be sent from emailB so it doesn't look like spam.

Hello, I have an issue with PHP form and how it sets email headers. I would expect "where to send the email" would be just used where submission should be sent. But it asigns it to field "from". There there's field "from" and when I leave it empty, it fills it up with email submitted in the form. But when I fill it up, then it sets it to "reply-to". It doesn't make sense. private function _getEmailHeaders($toEmail, $formEmail) { $headers = 'From: ' . $toEmail . PHP_EOL; $headers .= 'Reply-To: ' . $formEmail . PHP_EOL; $headers .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL; $headers .= 'Content-type: text/html; charset=utf-8' . PHP_EOL; return $headers; } Let say: I want submission to be sent to: emailA I want to see it's sent from: emailB And reply-to is set to: emailC (submitted by user) I receive submission in emailA, but instead it's set: sent from: emailA (should be emailB) reply-to: emailB (should be emailC) And emailC is just in the text of email I get. If I leave field "from" empty, it correctly fills it with emailC, but I still want it to be sent from emailB so it doesn't look like spam.
Vote to pay developers attention to this features or issue.
2 Replies
Order By: Standard | Newest
iveta.halanova2
5 Posts
iveta.halanova2 posted this 19 October 2020

Great, thank you

Great, thank you
Support Team
Support Team posted this 19 October 2020

Hi,

At this moment the "From" is used for "Reply to" only. But we asked our developers to use it for the email "From" too.

...................................................
Sincerely,
Olivia
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, At this moment the "From" is used for "Reply to" only. But we asked our developers to use it for the email "From" too. ................................................... Sincerely, Olivia Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
You must log in or register to leave comments