*SOLVED* Need to show the from email address entered by user.

Issues related to forms.
Post Reply
equalizer1001
 
 
Posts: 29
Joined: Thu May 17, 2018 3:05 pm
Location: Ohio USA

*SOLVED* Need to show the from email address entered by user.

Post by equalizer1001 »

I have a contact form, when sent, that needs the from field in the email header to show the user who filled out the form's email address field. I've tried putting the form variable "$emailAddress" in the "More Form Processing Properties" 'From:' field. When run, it causes it to jump to the error page that is set up. I have researched this issue in vein. Any help would be greatly appreciated. Thanks...
Last edited by equalizer1001 on Wed Mar 27, 2019 7:56 pm, edited 1 time in total.
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Need to show the from email address entered by user.

Post by Pablo »

You cannot use a variable in the form address. This property is meant to be used to configured a fixed email address because some servers do not allow email addresses outside the domain.
If you leave this field empty then the 'email' form field will be used in the email header.
See also the help.
equalizer1001
 
 
Posts: 29
Joined: Thu May 17, 2018 3:05 pm
Location: Ohio USA

Re: Need to show the from email address entered by user.

Post by equalizer1001 »

I need the email that is generated by the form to show the email address of the person that filled out the form
If I leave the email address set in the form processing section blank it generates an error:

Fatal error: Uncaught Error: Class 'PHPMailer\PHPMailer\Exception' not found in /homepages/2/d543166077/htdocs/uayaperogies.test/PHPMailer.php:1410 Stack trace: #0 /homepages/2/d543166077/htdocs/uayaperogies.test/PHPMailer.php(1348): PHPMailer\PHPMailer\PHPMailer->preSend() #1 /homepages/2/d543166077/htdocs/uayaperogies.test/contact_us.php(232): PHPMailer\PHPMailer\PHPMailer->send() #2 {main} thrown in /homepages/2/d543166077/htdocs/uayaperogies.test/PHPMailer.php on line 1410
User avatar
Pablo
 
Posts: 21575
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Need to show the from email address entered by user.

Post by Pablo »

I need the email that is generated by the form to show the email address of the person that filled out the form
By default, if your form has a field 'email' this will be used as the from address.
Do not enter anything in the 'from' address in form properties because this will override this behavior, as mentioned in the help

See also the FAQ:
How can I make sure the 'from address' in the email message is the entered email in the form.
viewtopic.php?f=10&t=32967
equalizer1001
 
 
Posts: 29
Joined: Thu May 17, 2018 3:05 pm
Location: Ohio USA

Re: Need to show the from email address entered by user.

Post by equalizer1001 »

Thank you very much... It is working... I had the email text box field name set to emailAddress. I changed it to email and all is well...
Post Reply