Setting the from email address on a form

1 reply · opened Jan 4, 2022

TthewebdeptJan 4, 2022

Hi

Can you tell me how I change the from email address on a website form.

I want to edit form.php and change no-reply@website.com to the email address of the sender. What should I use to do this?

$fromemail = array(
'email' => 'no-reply@website.com', // Company's Email Address (preferably currently used Domain Name)
'name' => 'Company Name' // Company Name
);

Thanks

SSemicolon WebSTAFFJan 5, 2022

Hello,

Changing the from Email to a Dynamic Email Address of the User filling the Form will result in SPAM and 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 in your Email Replies.

To enable this, simply add the following code inside your <form>:
[ch_pre][/ch_pre]

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

This will definitely work fine. 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