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.
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
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.
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
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.
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
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?
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.