change sender's email in form.php

1 reply · opened Apr 14, 2022

GgherardoApr 14, 2022

Hello,
In form.php, is there a way to change the Sender's Email to the email entered by the user in the form?

$fromemail = array(
'email' => 'user email here', // Company's Email Address (preferably currently used Domain Name)
'name' => 'user name here' // Company Name
);

Thank you for your answer!

Gherardo

SSemicolon WebSTAFFApr 14, 2022

Hello,

Changing the from Email to a Dynamic Email Address of the User filling the Form will result in SPAM on the Mail Clients and in some cases, even your Hosting Servers will block this.

Meanwhile, this can be fixed easily by simply adding a replyto address. You can simply add a replyto Field to your Form Settings so that when you press the Reply Button on the Emails you have received through your Forms, automatically adds the Sender's Email to the Reply Address box.

To enable this, simply add the following code inside your <form>:
[ch_pre]<input type="hidden" name="replyto" value="template-contactform-email">[/ch_pre]

The template-contactform-email above is the Form Field name of the Email Address value submitted by the User.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard