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.

Contact Form: Your email had no valid recipients.

September 05, 2012 4:43am

Subscribe [1]
  • #1 / Sep 05, 2012 4:43am

    Adam Christianson

    115 posts

    This question may be related to a resolved thread.

    I have a contact form on my site very simlar to the one mentioned in this port:
    http://ellislab.com/forums/viewthread/203996/#953530

    basically i’m doing this:

    <?php
    $author_id = $this->EE->uri->segment(3);
    $results = $this->EE->db->query("SELECT exp_members.email FROM exp_members WHERE exp_members.member_id = '".$this->EE->db->escape_str($author_id)."' LIMIT 0,1");
    $author_email = $results->row('email');
    ?>
    
    {exp:email:contact_form user_recipients="no" recipients="<?php echo $author_email; ?>" redirect="0" charset="utf-8" return="{site_url}/{segment_1}/{segment_2}/{segment_3}/{segment_4}/{segment_5}/email_thanks/|Return to {segment_4}'s Page"}
    
    
    <h3>Email <?php echo(urldecode("{segment_4}")); ?></h3>
    <p>{if segment_6 == 'email_thanks'}<br />
    Your email has been sent. Thanks.</p>
    
    <p>[removed]<br />
        jQuery(document).ready(function() {<br />
            jQuery('.fade-message').delay('3000').fadeOut('slow');<br />
        });<br />
    [removed]<br />
    {/if}<br />
    <input type="hidden" name="to" size="40" value="<?php echo $author_email; ?>"/></p>
    
    <p>  <label for="name">Your Name:</lable><br />
      <input type="text" name="name" size="40" value="{member_name}" /></p>
    
    <p><br />
      <label for="from">Your Email:</label><br />
      <input type="text" id="from" name="from" size="40" maxlength="35" value="{member_email}" /></p>
    
    <p><br />
      <label for="subject">Subject:</label><br />
      <input type="text" id="subject" name="subject" size="40" value="{if segment_6!=""}Re: {exp:low_title:entry entry_id="{segment_6}"}{if:else}TMO: {/if}" /></p>
    
    <p><br />
      <label for="message">Message:</label><br />
      <textarea id="message" name="message" rows="18" cols="40"></textarea></p>
    
    <p><br />
    {if segment_6!="" && segment_6!='email_thanks'}<textarea name="required" rows="5" cols="40" readonly="readonly">This is a response to: {exp:channel:entries entry_id="{segment_6}" limit="1" dynamic="off" require_entry="yes" status="{G-publish_statuses}" disable="categories|category_fields|custom_fields|pagination|member_data|trackbacks|primary_category"}<{comment_url_title_auto_path}>{/exp:channel:entries}</p>
    
    <p></textarea></p>{/if}</p>
    
    <p>{if captcha}<br />
      <label for-"captcha">Please enter the word you see in the image below:</label><br />
      {captcha}<br />
     <input type="text" name="captcha" value="" maxlength="20" /></p><br />
    {/if}</p>
    
    <p><input name="submit" type='submit' class="button" value='Submit Form' /></p>
    
    <p>{/exp:email:contact_form}

    I’m running this under EE 2.5.1 and the odd thing is that in a test environment it ran fine, but now deployed to my production server I get the error:

    “The form you submitted contained the following errors

    Your email had no valid recipients.”

    I’m at a loss. Here is a link for a page with the actual form if you want to test it for yourself.

  • #2 / Sep 06, 2012 4:06pm

    Kevin Smith

    4784 posts

    Hi Adam,

    I suspect it’s a simple thing. Do you have PHP enabled for the template and set to PHP on Input?

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

ExpressionEngine News!

#eecms, #events, #releases