ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Email Contact Form Issue

October 05, 2011 10:41pm

Subscribe [4]
  • #1 / Oct 05, 2011 10:41pm

    yellowdogsc

    3 posts

    I am still learning my way around ExpressionEngine and love it.  I have another issue that should be easy, but I can not figure it out.  I am using the example Email Contact Form from the user guide and getting the following error:


    The following errors were encountered

    Your email had no valid recipients.
    Return to Previous Page

    Here is the code:

    {exp:email:contact_form user_recipients="false" recipients="[email protected]" charset="utf-8"}
     <h2>Support Form</h2>
    <p> <label for="from">Your Email:</label></p>
    
    <p> <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p><br />
     <label for="subject">Subject:</label></p>
    
    <p> <input type="text" id="subject" name="subject" size="40" value="Contact Form" /></p><br />
     <label for="message">Message:</label></p>
    
    <p> <textarea id="message" name="message" rows="18" cols="40">Support Email from: {member_name}<br />
      Sent at:  {current_time format="%Y %m %d"}</textarea></p><br />
      <input name="submit" type='submit' value='Submit Form' /></p><br />
    {/exp:email:contact_form}


    Thanks
    Tommy

     

  • #2 / Oct 06, 2011 3:45pm

    Sue Crocker

    26054 posts

    Hi, Tommy.

    Can you send email to that same email address using Communicate? Is this a local install or on a professionally hosted server?

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

  • #3 / Nov 01, 2011 7:20pm

    yooliadesign

    18 posts

    I am having the same issue on a client’s site since the latest upgrade. His site is hosted with 1&1 in Germany. Posting to be notified.

  • #4 / Nov 02, 2011 10:09am

    Sue Crocker

    26054 posts

    yooliadesign - can you send email from Communicate?

  • #5 / Nov 02, 2011 3:12pm

    yooliadesign

    18 posts

    yes i can.

  • #6 / Nov 04, 2011 1:02pm

    Kevin Smith

    4784 posts

    Hi Tommy and yooliadesign,

    I tested the code posted in Tommy’s first post in my own installation, and it worked as expected. (yooliadesign, if you could share your code here, that would help a lot.)

    What versions EE are each of you using? Has anything changed recently with your environment? (EE upgrade, server upgrade or change in configuration, etc.) If so, what were those changes?

    Is there anything else in the template with this? If you move this contact form code to its own template and try it there, does it work as expected?

    And on a technical note, the user_recipients parameter should actually be set to either yes or no rather than false, though that particular bit isn’t causing the problem here.

  • #7 / Nov 04, 2011 4:26pm

    yooliadesign

    18 posts

    The site I am referring to uses 2.2.2 and worked fine until I upgraded to that. There were no changes to the code itself before or after the upgrade. Here is the code (I changed the name of the website to “nottherealnameofthesite” so that this discussion won’t show up in search results for my client’s site):

    {embed="embeds/html_header"}
    <body id="kontaktseite">
    
    <div id="wrapper">
    
    <div id="header">
    <h1>
    <a href="http://www.nottherealnameofthesite.de/index.php">http://www.nottherealnameofthesite.de/images/header.png</a>
    </h1>
    </div>
    
    
    <div id="content">
    
    {snp_navigation}
    
    <div id="maincontent">
    
    <h2>Kontakt</h2>
    
    <p>{exp:channel:entries channel="kontakt" orderby="date" sort="asc"}<br />
    <div id="entry"></p><h3>{title}</h3>
    <p>{summary}<br />
    {full_entry}</p>
    
    <p>{if mp3}<br />
    <div id="wimpy_player"><br />
        </p><h5>Anhören</h5><p> <br />
    {embed="embeds/wimpy-button the-audio-file="{mp3}" the-entry-id="{entry_id}"}</p><h6>Für optimales Hörvergnügen wird empfohlen, diese Webseite in <a href="http://www.mozilla.com/en-US/firefox/fx/" target="_blank" rel="noopener">Mozilla Firefox</a>, 
     <a href="http://www.google.com/chrome" target="_blank" rel="noopener">Google Chrome</a> oder <a href="http://www.opera.com/browser/download/" target="_blank" rel="noopener">Opera</a> anzusehen. 
     Zum Abspielen wird die aktuellste Version des Flash Players benötigt, <a href="http://get.adobe.com/flashplayer/" target="_blank" rel="noopener">hier</a> verfügbar.</h6>
    <p>    <br />
    </div><br />
    {/if}</p>
    
    <p></div> <!-- end #entry --><br />
    {/exp:channel:entries}</p>
    
    <p><div><br />
    {exp:email:contact_form user_recipients="false" recipients="" charset="ISO-8859-1" <br />
    return=""}</p><h3>Anfragen, Mitteilungen und Kommentare sind jederzeit willkommen.</h3>
    <p><label for="from">Deine eMail-Adresse:</label><br />
    <input type="text" id="from" name="from" size="40" maxlength="35" /></p><br />
    <label for="subject">Betreff:</label><br />
    <input type="text" id="subject" name="subject" size="40" value="" /></p><br />
    <label for="message">Deine Nachricht:</label><br />
    <textarea id="message" name="message" rows="18" cols="40"></textarea></p>
    
    <p>{if captcha}<br />
    Bitte gib zur Verifizierung das unten abgebildete Wort in das Feld daneben ein:<br />
    {captcha}</p>
    
    <p><input type="text" name="captcha" value="" maxlength="20" /></p><br />
    {/if}</p>
    
    <p><input name="submit" class="submit_button" type='submit' value='Email abschicken' /></p></p>
    
    <p>{/exp:email:contact_form}</p>
    
    <p></div></p>
    
    <p></div> <!-- end #maincontent --></p>
    
    <p></div> <!-- end #content --></p>
    
    <p>{snp_footer}

  • #8 / Nov 04, 2011 4:28pm

    yooliadesign

    18 posts

    Now that I think about it, are you sure the “false” user recipients couldn’t be the cause? Because the error message does say “Your email had no valid recipients”.

  • #9 / Nov 07, 2011 4:32pm

    Kevin Smith

    4784 posts

    Now that I think about it, are you sure the “false” user recipients couldn’t be the cause? Because the error message does say “Your email had no valid recipients”.

    Does the behavior change if you change the value of user_recipients to “no”? Based on my review of the code for the module, it shouldn’t matter, but I just thought I’d clarify for the sake of having things done based on what the User Guide recommends.

    What if you try your email form in its own template? I suspect there’s something in your template that keeps it from working properly. One thing I did notice is that your embed tag pointing to embeds/wimpy-button doesn’t properly close one of the parameters with a quote mark. It should look like this:

    {embed="embeds/wimpy-button" the-audio-file="{mp3}" the-entry-id="{entry_id}"}
  • #10 / Nov 07, 2011 4:52pm

    yooliadesign

    18 posts

    Oh, thanks for catching that missing quote. I tried the code just as you see below, by itself in a template, and I still get the “No valid recipients” error message. Even with recipients set to “none”.

    <div>
    {exp:email:contact_form user_recipients="no" recipients="" charset="ISO-8859-1" 
    return=""}
    <h3>Anfragen, Mitteilungen und Kommentare sind jederzeit willkommen.</h3>
    <p><label for="from">Deine eMail-Adresse:</label><br />
    <input type="text" id="from" name="from" size="40" maxlength="35" /></p><br />
    <label for="subject">Betreff:</label><br />
    <input type="text" id="subject" name="subject" size="40" value="" /></p><br />
    <label for="message">Deine Nachricht:</label><br />
    <textarea id="message" name="message" rows="18" cols="40"></textarea></p>
    
    <p>{if captcha}<br />
    Bitte gib zur Verifizierung das unten abgebildete Wort in das Feld daneben ein:<br />
    {captcha}</p>
    
    <p><input type="text" name="captcha" value="" maxlength="20" /></p><br />
    {/if}</p>
    
    <p><input name="submit" class="submit_button" type='submit' value='Email abschicken' /></p></p>
    
    <p>{/exp:email:contact_form}</p>
    
    <p></div>

  • #11 / Nov 10, 2011 10:28am

    Sue Crocker

    26054 posts

    Hi, yooliadesign.

    Is there a reason why the recipients field is empty, and there is no To field in the form?

  • #12 / Nov 10, 2011 12:17pm

    yooliadesign

    18 posts

    I want the “to” email hidden from view, to prevent spam. Is there a way to do that differently? And if that is the issue, why did it work before the update to 2.2.2?

    UPDATE: Never mind, Sue, you cracked it! It’s working again, I just had to add an email address in “recipients”. What a silly mistake!! Thank you so much!

  • #13 / Nov 11, 2011 10:33am

    Kevin Smith

    4784 posts

    Glad we were able to get you taken care of, yooliadesign! Let us know if we can help again in the future.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases