Contact form in RW8 won't work

Just upgraded to RW8 and having fits.

The contact form returns: “I’m sorry, there seems to have been an error trying to send your email. Please try again.”

I have the PHP checked, I have the use this mail clicked. I tried within EW8 and on Safari.

No joy!

I poke around the forum and someone wrote that I need to have an email address on the same domain. The same domain as the web hosting site??

The contact form work just fine in RW5. Nothing changed, except in RW8, it won’t work.

Help!

Mike

I couldn’t find a form in the standard stacks but did find one in Foundry which has the same text as the error you gave. Perhaps that was what you used.

Just built a new test site, loaded to the host and tested with “send using your email address” ticked and also unticked. It worked for both.

Th only thing I added to the form settings was adding my email address to the “your information” section.

RW8.7, Big Sur and Stacks4.1.2

The option for using “Send using your email address” might be picked if you have problems receiving email from the server that is not technically allowed to send on your behalf. This is a where an SPF (Sender Policy Framework) record is use din your DNS settings to tell email servers that this hosting server can send email using your domain name.
If you tell you email server to accept email from your hosting server then you should get away with not requiring an SPF record as its only you that might be receiving the form emails anyway.

thanks for the reply

well I have Foundry, and put in the forms stack.

guess what? It didn’t work either. This time, nothing happened, no error messages, just nothing happens. No emails are sent.

This should be really simple.

I downloaded DooBox(?) and the mailto stack worked. However the contact stack didn’t. I sent them an email asking for help, too

You are right, It should be simple.

I checked my hosting and found my PHP was at v5.6 so I brought it up to v7.4 and all forms continued to work

The only time I got the foundry form to fail with that error message you listed was when i left the “your information” email address unpopulated.

No problem. I tripled checked that

When this form is added to a page the page becomes a .php file instead of the usual .html extension.

Looking at the file I can see that the form uses a mail function built into PHP. See snipping below.

// If there are no errors, send the email
if (!$errName && !$errEmail && !$errSubject && !$errMessage && !$errHuman && !$errConsent) {
  if (mail ($to, $subject, $body, $headers)) {
    $result='<div class="alert alert-success">Success! Your message has been sent!</div>';
  } else {
    $result='<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later.</div>';
  }
}

If the mail function is erroring then I would be led to believe that the host is not allowing email via PHP, or PHP itself is having an issue. The form won’t allow the email to send if any parts of the form are empty but those sections generate different errors.

Sorry it’s not much help but as you say this code is real simple and it should just work.

Reading a little further…

The email function in PHP only returns an error of true or false. The mail function itself passes the email to the email server on the host which is defined in the php.ini file possibly under the variable sendmail_path

Nick,

I sent an email to my hosting company. I poke around inside via the cpanel and it appears that PHP was set at version 5.xx. I changed it to 7.XX and still no joy.

what bugs me the most is it worked just fine in RW5, no problems at all. Upgraded to RW8 and everything went to pot. I had to purchase all new versions of the stacks and other goodies I was using. So far, I’m in the hole by about $300 and still can’t send an email.

That’s what I find strange too Mike.

There should be no reason why RW5 and RW8 should stop a PHP function from working. Especially one as simple as mail.

If i spin you up an account on my host would you be happy to try posting there just as a test?

I think I could do that. I’m not much of a FTP person, so if you can send me a link so I can copy/paste into RW8 so it can do publish without an external FTP program that would be great

I’ll make a site with all three contact forms

PM with details sent

Sending mail can be a bit tricky and is getting more and more difficult all the time. Most hosting companies have tightened up their requirements due to spammers.

The last thing you want is the server (IP address) that your site is on to start getting tagged as a spam Portal.

Debugging PHP problems can also be tough, by default PHP doesn’t show errors to the browser. It should instead log errors to a file on the server, assuming that the host hadn’t turned off the logging function.

Where this log file is located is determined by the hosting company. So my first step would be to have a look at the Knowledge Base (if the host has one) and see if you can find where the put the log files. You can also check to see if they have any special requirements for sending mail or form submission.

As for PHP versions, PHP 5.6(the last PHP 5 version) hasn’t been supported or even had a security update in almost 2 years, so it really shouldn’t be in use or even available. PHP 7.3 is the oldest version that should be in use (7.2 security support expires tomorrow), and you should be on 7.4 if you can.

Apparently… What use to be easy to do, now makes one jump though a lot of hoops. However that being said, no one likes spam.

I opened a trouble ticket with my hosting company. I’m waiting on them to return my ticket.

I’ve been up since 3am EST working on this simple problem, and still no joy

Who are you hosting with? There’s a good chance that someone else might be hosting with them and can shed some light on the issue.

Also what version of PHP are you using? You mentioned 7.x is that 7.0, 7.2, etc,?

And what stack are you wanting to use? You mentioned a few.

Nick…

Interesting experiment. Here’s what I found out by putting those files on your server:
The RW8 contact form appears to work, no errors
The doobox stack appears to work, no errors
The Foundry forms stack doesn’t show up on the page

HOWEVER!!

While all say the email has been sent, it doesn’t seem to be the case. I received none of my test messages. I double and triple checked to make sure I had the proper email in the stack, but nothing came though.

So apparently there is some kind of setting out of whack with my hosting company. However that doesn’t explain why I didn’t receive the emails

The plot thickens!

its called qth.com. I’ve been with this guy for 12 years or so. Like I said, everything works fine. Until I tried RW8

I used the ‘contact form’ within RW8.
A stack called contact from Doobox
and the form stack within Foundry

All of these (except for Foundry) send back an error. The foundry doesn’t do anything, but sits there.

For the Foundry ones, please try to use the settings you can apply there.

For the normal Form:
image

For Form Pro:

would you mind emailing me your rw8 file?

that’s really strange about the contact form from foundry

i live about 15 miles from the old healthkit factory in Gloucester, UK.

Interesting experiment. Here’s what I found out by putting those files on your server:
The RW8 contact form appears to work, no errors
The doobox stack appears to work, no errors
The Foundry forms stack doesn’t show up on the page

HOWEVER!!

While all say the email has been sent, it doesn’t seem to be the case. I received none of my test messages.

Well that was interesting. I had a look on my server and the page for the foundry form was giving a php parse error on the $human test. It wrote the error log to the directory of the page if you want to view it. The $human cannot be empty so adjusting index.php to expect a score of 5 and the form works. Tells me if it sent it fine. I called the new file index-2.php if you want to try from your end.

So we can conclude that the files your are creating in RW8 and uploading to a server do actually work and say they are sending emails. But not from your server?

Are you able to check in your email server if the forms arrived at your end but were blocked as spam or spoofed emails?

Everyone

First off I want to thank all those that reached out to help me with a simple problem, that wasn’t so simple.

A special thanks to ‘Nick’ who offered some space on his server to iron things out.

Here’s what happened:

First off, apparently there was an issue with my hosting company. BUT!! As it turned out, there wasn’t one after all with the host’s server.

Apparently, the mail form from within RW8 and the forms stack I used simply didn’t work free standing. I contacted my host server and he said all was fine on his end, the latest PHP was running. All was good. He suggested that I upload a test site. I had to add a subdomain, and named it according. Then I used FTP to send the RW8 files to it. Whoa! Worked fine with one issue. the Foundry stack ‘forms’ didn’t.

As it turned out, that stack didn’t work on Nick’s server either. Nick later found an issue with the index.php in which there was a missing test condition.

Unfortunately I haven’t been able to get the ‘forms’ stack to work with Foundry. An email to them has fallen on deaf ears

So I consider the problem to be 99.4% fixed. I can live without the Foundry form stack, as I have others that work now, including the contact form within RW8

The bottom line as they say?

The forms structure work provided I test within my hosting server. In my house, on my computer, in my environment, the mail out forms didn’t work within RW8 or using Safari. Only after I had them upload to my server’s host did the forms work.

Again, thanks for everyone’s help.