The primary reason that many of the larger and more well known hosting companies are starting to depreciate the PHP sendmail function is due to email abuse. Typically, abuse falls into two basic categories - weak scripts that use the sendmail function, or exceeding mail quotas that can lead to spam complaints and IP blocking. In the first category, a weak script may be compromised by spammers and the script itself becomes a spam gateway. This, in itself can cause mail quotas to be exceeded without the knowledge of the domain owner. In the second category, website owners may be using a script for mass-mailings to their own opt-in lists or more general lists acquired from list brokers. In any event, such activity tends to eat up shared resources on shared hosting accounts and can easily lead to the common server IP address being blocked by other servers around the world. So, it’s probably easy to understand why some hosting companies are forcing the use of SMTP, as this route requires a correctly configured, password protected email account through which to route emails. By doing this, if an email account on a shared hosting starts exceeding limits, the host can issue a denial of service notice and temporarily (or permanently) disable the offending email account. Clearly, the aim is not to fustrate domain owners, but to protect them from being unfairly black listed. A typical shared server may have thousands of domains - it only needs one of them to cause the main server IP to get blocked, and everyone suffers as a result.
I’ve got a number of clients who have faced this problem. It usually happens with larger web hosts in Europe, particularly France and Belgium, but I’ve also seen it increasingly in Asia. When this becomes an issue, I simply don’t use the standard blocs email generated script (as good as it is). Instead I use the Tectite Formmail script and simply point the Blocs webform to the URL of that script. The good thing about the Tectite script is that it uses the standard PHP sendmail function by default, but it can also be easily configured to use SMTP using the Pear settings. This is how the configuration lines look:
Once the script has been edited to use these settings all your forms will be delivered by the SMTP email account instead of via the PHP sendmail function.
This script option also gives you a number of other useful features that limit what can be entered on your forms and even reject emails that look like spam. You can also configure where your responses get delivered on a form-by-form basis (single or multiple email addresses) and you can even have each form in your site redirect to different success or failure URL’s. This is done through the use of hidden fields on your form. If you feel uncomfortable about including recipient email addresses in a hidden field on your form, you can create a simple ini file that uses an alias and an email address. You would then use the alias in your html form instead of a real email address. This is how this option works:
To add a hidden field in blocs, just add a standard field without a label and change it to Hidden. You would then use the custom attributes section to add the “name” and “Value” elements of the field
So, until such time as Blocs has an SMTP option, the tectite script is a safe and reliable work-around that gives you many more functions and options than the standard Blocs script. It’s totally free (unless you want the developer to configure the script for you) and it’s been around a long time.
NOTE: Don’t confuse this script with the other Formmail Script from formmail dot com. Use only the Tectite script - the other one has a few security issues reported over the years - it may be a good script, but I wouldn’t chance it.