Send Form Action

SendForm is built into Freeway 7 (and it may have landed before that, but it’s been a long time and I don’t recall the dates very well). It has a number of improvements over the older PHP Feedback Form Action, including a more modern coding style in its generated PHP helper that allows it to run under much newer versions of PHP without having to suppress warnings or errors. If you are building a new contact form from scratch, it should be pretty easy to apply, and it should work okay with fairly modern PHP versions. There’s a section in the built-in manual regarding its use.

However – and this is a big however – modern SPAM filtering techniques have evolved to the point where getting your mail delivered consistently if you are sending directly from some random shared hosting Web server is no longer a matter of being a good citizen and following the rules. The server you are using to send the mail needs to be “blessed” by your domain records and also not on any of the “real-time block lists” out there. If you are using a shared server, or even a virtual private server from a provider like DigitalOcean or Linode, the odds are good that the IP address of your server has been flagged by a previous user who was either hacked, or was actually up to no good. Once your IP address becomes entangled in this way, it becomes almost impossible for you to send mail to anyone with a Gmail or Outlook account, because your message is trapped as SPAM and never released.

The modern way to send mail is to use a service that specializes in what’s called “transactional messaging”, like SendGrid or Amazon’s SES. And that requires that your sending script on your site creates an authenticated connection to that service’s SMTP server. SendMail (and all the other Actions that preceded it) do not do that and can’t be made to do it the way they are written.

This is a very hard problem from the perspective of a “make it easy to configure in my static site” solution. As a long-time Action developer, I struggle to think how I could write something that would abstract away the genuinely hard work of establishing an account with one of these services, providing credentials in a way that would not get your account hacked (a real problem on a shared server), and then giving you the tools to figure out if it was working correctly.

If you use one of the many (paid) form hosting services out there that cater to the static site crowd, then your form will end up in an iframe on your Freeway page, which will work, but will take away a lot of the styling and layout control that you rely on Freeway to provide.

Walter

1 Like