Form to Email How To

My friend check the Sender fields…

You assigned there the POST inputs…

SENDER is you
assign your email to SENDER’s email and assign the POST inputs to RECIPIENT’s fields

In my input form it is the person name, their email, and their email again. This is a contact us form source would be the sender and recipient would be the vendor.

That is where the To Email goes to.

You try to send an email from the user’s email to your email… That’s wrong

You have set up an smtp…
So, you send the email based on the email of your smtp to an email of yours (probably the same email or another that you have access on it).

Your smtp email(SENDER) sends an email to your email(RECIPIENT) that ( in MAIL BODY) the person $_POST.input1 with email $_POST.input2 send a message $_POST.input3

Not doubting you. But what I struggle with then is the document:

It says to configure it the way I did. Which way is the right way?

I think there’s nothing wrong with that as crazy as it sounds cause the sender account is configured on the global option
tested with mail@mail.com and it works:
image
image

@mebroyles01 can you check the setup mail?
Should be something like:

Hi Everyone,

First thank you for those who have provided input. I just want to add a few things as I have worked on this for a while now.

First the video how to are correct. My form is a simple contact page. I have a Mailer defined under global and using smtp ssl. I defined an API. In my form I have it set as a server connect. I call that API and imported my form which populates my $_POST under input for the API. I then do a execute within that API and do a send mail. Then under send email I set the mailer to the global I defined. I use the server bind to pull in the post inputs collected from my form. So I use subject under general. Then sender I use the bind from the email filled in my the contact form. The to email I set to come to a defined email I want to. Mail body I use server bind from the comments also collect from the input form.

I have everything working almost and have 2 things that I want to share. First I use a 3rd party email. I also use GoDaddy for this web host. Issue is GoDaddy does not like to use 3rd party smtp emails. So I had to use one of their emails I created in the cPanel. Now here is where it gets tricky. Example: noreply@xyz.com from GoDaddy sends emails to anyone outside of xyz.com. Next I have sales@xyz.com hosted by RackSpace. Now I want to send email from noreply@xyz.com to sales@xyz.com after they complete the form. I have all the MX records defined on the DNS server. However; this is not working and this is 1 of the things I am working through and if you want me to continue to share I will update this for people who may want to know if I find a solution.

Second this is this in the debug in the response:
Fatal error: Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /pathtofile/dmxConnectLib/PHPMailer/PHPMailer/SMTP.php:279) in /pathtofile/dmxConnectLib/dmxConnect.php:84 Stack trace: #0 [internal function]: exception_error_handler(2, ‘Cannot modify h…’, ‘/pathto…’, 84, Array) #1 /pathtofile/dmxConnectLib/dmxConnect.php(84): header(‘HTTP/2.0 500 In…’) #2 [internal function]: exception_handler(Object(ErrorException)) #3 {main} thrown in /pathtofile/dmxConnectLib/dmxConnect.php on line 84

Fatal error: Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /pathtofile/dmxConnectLib/PHPMailer/PHPMailer/SMTP.php:279) in /pathtofile/dmxConnectLib/dmxConnect.php:45 Stack trace: #0 [internal function]: exception_error_handler(2, ‘Cannot modify h…’, ‘/pathto…’, 45, Array) #1 /pathtofile/dmxConnectLib/dmxConnect.php(45): header(‘HTTP/2.0 500 In…’) #2 [internal function]: fatal_handler() #3 {main} thrown in /pathtofile/dmxConnectLib/dmxConnect.php on line 45

I have read it has to do with the header and posting response. I am trying to debug but this is getting a little more advanced than my coding skills at this point. I know the info is above what to look for and when I open those files and look at the line number contents it has: header($protocol . ’ 500 Internal Server Error’);

Just trying to figure out what to do as a solution to get a clean response.

More to come. I know this is memory dump and jumbled together. I will take time to format it better later.