Form to Email How To

First of all, you need your button to be a submit button, so set its type to submit. Then you should apply the validation on the inputs directly not on form dynamic events.

I have tried it as a submit button. This config from this video as an attempt to see if it was me.
Links and I haved


Okay I have set the button as submit and removed the dynamic actions. Tested it and it still does the validation just does not clear the form or send the email yet. I appreciate the responses.

Here is how the form is currently

Remove the validation events please and check this:

1 Like

This is very helpful. Three things.
One I did get a 404 error and that was due to the text field being required.
I removed that validation
Now I get the message body is empty.
Attached is what I am using.
BTW I put something in there and tested it and get SMTP error and I will continue to work that as well however; need insight to what I am missing on the text binding.serveraction 10

Okay this debug thing is really helpful Teodor!!!
I set it to server default and just put test in my body to see if the form works and success. Getting way closer now. I am learning so thank you for your patience.
So need to know why text binding is failing on my side. Any other helpful tips there?
Will try to figure out SMTP why it fails.

Okay I updated the text to just say comments for ID and name. I then went to my API and set mail body to:{{$_POST.comments}}
That did it for getting the contents of the text field. Now more tweaking and getting some additional things in place. Any good tips for a redirect that email was sent successful and that someone would contact them within 24 hours and where it should go?

Again thanks to Teodor. For those trying to set this up this should be the first go to as it’s a time saver.

Hey!

On the form properties, use a “succesfull” dynamic event and then (when the api is succesfuly) you can redirect to another page using the browser component (previously added to the page). Or you can set it to open a modal. You can choose.

Ps you can use other events like error/unauthorized/invalid

Okay been doing some digging and nearly have SMTP all setup. Had some additional backend work to do as well.

Now with the debug mode I am now getting connectivity. However; my last part in the response is this error after the SMTP connection and looking for tips and tricks on how to address this. I am still fairly new at web dev and still learning.

The error. I get 200 post in debug and the response tab has this:
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

Now I did change the path to just for this post. It is not the real path.

Also, I did open up the two files referenced above and looked at the line number content:
header($protocol . ’ 500 Internal Server Error’);

Can you share a screenshot of your Sendmail step and please explain the fields you have assigned there…

Sure. Also, using SMTP for the mail and SSL port 465. That all seems to go okay as far as connecting.

There’s no need to add the ‘setup mailer step’ if you have it under global.

Can you check the project publisher to check if all the files are uploaded to the server? Maybe something is missing.

1 Like

Removed setup and verified files are all present on the web server. Same result. Just not 100% sure which way to go here.

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: