Coffeeform Tweaks - Post ID 25644

User 48308 Photo

83 posts

Because I had some problems with the form and the message delivery I decided to slightly modify the script as follows.

Line 158:
The Content-Type of the sent-out emails was somehow part of the body instead of the header, so extended ASCII and intl. chars. looked cryptic. Line 158 changed to
$headers = "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset=UTF-8\n\n";

Line 163:
Setting the visitor's/subscriber's email as sender (From) may be problematic in case the domain has an SPF / TXT record. It is better to use our own email address as both sender and recipient and to add our visitor's email as Reply-To.
$sentMail = mail($mailto,$subject,$newMsg,"Reply-To: $email\r\nFrom: $mailto\r\n$headers");

Line 194:
To make the confirmation page look nice with extended ASCII or intl. chars. too, a new line was added between line 193 and 194.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
User 132952 Photo

3,120 posts

I'll have to try that out. Much appreciated.
User 48308 Photo

83 posts

Here is a download version so you don't have to fiddle with the code. I recommend to back-up the original coffeeform before (eg. rename it to coffeeform_bak.php or the like).

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.