Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Mailform4-Talk

Summary: Talk page for Mailform4.
Maintainer: MKonrad, AntonyTemplier (i18n)
Users: (View? / Edit?)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Failure sending email

24-Jun-2010 Allan?: This recipe looks like just what I'm looking for! But I'd like some help, please; I'm having a problem sending the email. I followed the instructions for installation (CAPTCHA and Mailform4). I tested that I got the warnings/errors as expected when I didn't enter values for Name, Email and Message (text). Captcha also works - I got the correct warning when I didn't get the captcha right. But when everything else is ok, the send fails with "Failure sending email."

I'm using PmWiki version pmwiki-2.2.16 (and the Choice Skin)

(Just an FYI, I noticed that in the mailform4.zip file, there were two /cookbook/mailform4.php files. One looks like it's a previous version. I looked for the difference. The most recent version refers to, at some point, Mailform where the other refers to a generic Recipe Name.)

Thanks in advance for any help.

Update: 26-Jun-2010 Allan?: I found where the sending of the mail is failing, if not yet exactly why. At least the way I've installed it, the values for Recipient, Subject and Sender seem to be empty even though I set those in local.config. I haven't had time to work out why they're not being populated properly yet, but for now, what I did to get this going was to hard-code the values for those variables inside mailform4.php. Ouch, but at least I've got it working for now.
So the code in mailform4.php that looks like this:
       if (!mail(
          $Mailform4Recipient,
          $Mailform4Subject,
          $msgTpl,
          'From: ' . $Mailform4Sender))
I've set to something like this:
      if (!mail(
          'recipient@mydomain.com.au',
          'New message',
          $msgTpl,
          'From: from My Website Contact Form'))
Luckily, the email that actually gets sent includes the values entered on the contact form for Your name, Your email address, and Your message, so you shouldn't lose any info typed in by the website visitor. Hope this helps someone! - Allan
MKonrad July 11, 2010, at 05:35 AM
Hi Allen, I examined my code again and found the bug... it's fixed now. Could you try it out again, please?
I also deleted the second mailform4 file. It was a .php~ file, that my editor automatically created as a backup.
Allan? July 14, 2010, at 12:20 PM
Hi, thanks for that. It's working now. Moved the new files across. Used the mailform twice and both worked. Before I sent the second, I changed the Subject and Recipient in the config.php file and the changes were reflected correctly on the email that I received. Good stuff. Thanks again for this recipe, much appreciated.

Talk page for the Mailform4 recipe (users?).

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 11:42 AM