Right now I added a form HTML code to a body text on a node. It works but now I need to add captacha and it;s not working because it doesn't access the form itself.

How do you create a simple form that emails someone the contents but does not create a node/record?

Thanks.

Comments

Barrett’s picture

Check out Webform

webdev2’s picture

Thanks - I'll check it out.

webdev2’s picture

It built it fine but it is NOT sending the submission to the email I entered in the config form. It is being saved because I can go back and see saved submissions, however.

Any ideas?

Barrett’s picture

Are you sure it's not sending, as opposed to it not being received? Unless you have strong evidence that it isn't leaving the server I'd bet that it isn't being received and is ending up in a spam filter or something.

What's the content of the "Webform mail settings" section of the form?

webdev2’s picture

The contents are:
E-mail to address:
info@client_domain.com

and it is a valid email address.

webdev2’s picture

I have verified the email is not being sent. Any ideas?

Barrett’s picture

Is there anything in your logs? I would expect a PHP error if mail settings weren't configured correctly on your system.

justageek’s picture

How did you verify that the mail is not being sent, out of curiosity mostly. I have found that on certain hosting services, php cannot send email to an email address on the same domain for some reason. Can you try a gmail address or something and see if that might work?

webdev2’s picture

You're right, I don't know email are being sent. I checked the logs for any errors, changed the recipient email address and it goes nowhere.

webdev2’s picture

I checked the logs - nothing. I checked the webform results - it is a record there. I sent it to another domain - nothing.

This domain does send email properly using other modules - CIVICRM, RULES,...

Barrett’s picture

Couple options:

  1. In admin/settings/webform, set the Advanced Options>Webform options to Full Debug and see if the output it shows when a form is submitted tells you anything useful.
  2. In webform.module add a watchdog line to the code (in webform_client_form_submit()) that actually sends the email. So...
       1822       // In the case of checkboxes or multiple select, multiple e-mails may need
       1823       // to be sent out.
       1824       if (is_array($address)) {
       1825         foreach ($address as $single_address) {
       1826           drupal_mail('webform', 'submission', $single_address, user_preferred_language($user), array('message' => $messages[$cid], 'subject' => $subjects[$cid], 'headers' => $headers[$cid]), $froms[$cid]);
    

    becomes

       1822       // In the case of checkboxes or multiple select, multiple e-mails may need
       1823       // to be sent out.
       1824       if (is_array($address)) {
       1825         foreach ($address as $single_address) {
       1826           watchdog("WTF","Sending mail to $single address");
       1827           $email_sending_result = drupal_mail('webform', 'submission', $single_address, user_preferred_language($user), array('message' => $messages[$cid], 'subject' => $subjects[$cid], 'headers' => $headers[$cid]), $froms[$cid]);
      1828            watchdog("WTF", "Success sending message = ". $email_sending_result['result']);
    

    That should give you a line in the log that will at least tell you if it's hitting that function and a second one that tells if sending succeeded. Like it says in the drupal_mail function reference though (http://api.drupal.org/api/function/drupal_mail/6), that only tells you if it was passed to the php layer successfully.

webdev2’s picture

To be sure we're on the same page, I am using webform for D5.

I tried the two above debug steps. Setting webform to debug showed a properly formed email in an array and nothing obvious I could spot. The whole site uses SSL but that doesn't effect other modules that send email.

The second option left no traces in the log. Assuming those commands work in D5, this would show it's never getting past the:
foreach ($address as $single_address)

line. In which case, there is something more deeply wrong with the module.

It's disappointing, I was really hoping this would work.

Your thoughts?

Barrett’s picture

No idea. The watchdog function does work for d5 (http://api.drupal.org/api/function/watchdog/5). Try submitting an issue the webform issue queue, maybe.