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 to

March 31, 2011 6:57am

Subscribe [3]
  • #1 / Mar 31, 2011 6:57am

    Kreativ

    16 posts

    Hi,

    I’ve been experimenting with a form for people to invite others to the site, so I basically just used the example Email Contact Form with ‘recipients’ and it seems to work fine, but I would like of course like my visits to choose who to send to (friends email address). So I added a ‘to’ according to the instruction and here is my code:

    {exp:email:contact_form user_recipients="false" charset="utf-8"}
    
        <label for="name">Your Name: </label>
    
        <input type="text" id="name" name="name" size="40" maxlength="35" value="" /></p>
    
        <label for="from">Your Email:</label>
    
        <input type="text" id="from" name="from" size="40" maxlength="35" value="" /></p>
    
        <label for="to">Friends email: </label>
    
        <input type="text" name="to" size="40" /></p>
    
        <label for="subject">Subject:</label>
    
        <input type="text" id="subject" name="subject" size="40" value="Invitation" /></p>
    
        <label for="message">Message:</label>
    
        <textarea id="message" name="message" rows="18" cols="40">something written here</textarea></p>
    
    {if captcha}
    Please enter the word you see in the image below:
    {captcha}
    
    <input type="text" name="captcha" value="" maxlength="20" /></p>
    {/if}
    
            <input name="submit" type='submit' value='Submit Form' /></p>
    
    {/exp:email:contact_form}

    But when I try to send an invite from this form to one of my email accounts, I never receive anything. Can you see any reason why this is not working?

    I’m on EE 1.7 (Build:  20101018)

    Thanks,

  • #2 / Mar 31, 2011 5:37pm

    Sue Crocker

    26054 posts

    Hi, Kreativ.

    Take a look at this doc page:

    http://expressionengine.com/legacy_docs/cp/admin/system_preferences/email_configuration.html

    Make sure you have Webmaster or site name for auto-generated emails set, some mail servers will cause your emails to be considered spam.

    Try using the Communicate Module. Can you receive emails sent that way?

  • #3 / Mar 31, 2011 8:44pm

    Kreativ

    16 posts

    I’ve filled out all the fields for email configuration and tested sending an email via Communication Module and it all worked fine.
    I put the debugger on when i sent a message using the Communication Module and this was the log if that can help:
    ————————-
    Debugging Message
    220-SYDS9-N2S.hosting-services.net.au ESMTP Exim 4.69 #1 Fri, 01 Apr 2011 10:40:16 +1100 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
    hello: 250-SYDS9-N2S.hosting-services.net.au Hello rev6-syds9-n2s.hosting-services.net.au [112.140.181.33]
    250-SIZE 52428800
    250-8BITMIME
    250-PIPELINING
    250-AUTH PLAIN LOGIN
    250-STARTTLS
    250 HELP
    from: 250 OK
    to: 250 Accepted
    data: 354 Enter message, ending with “.” on a line by itself
    250 OK id=1Q5RTM-00028U-Ta
    quit: 221 SYDS9-N2S.hosting-services.net.au closing connection
    Your message has been successfully sent using smtp
    ————————-

    I’ve checked if I’ve received anything in the spam folder of my mail box - nothing there.

  • #4 / Apr 04, 2011 4:09am

    John Henry Donovan

    12339 posts

    Kreativ,

    user_recipients="false"

    You need this set to true as per the docs if you wish to use the to field

  • #5 / Apr 04, 2011 4:13am

    Kreativ

    16 posts

    there you go, thanks John!

  • #6 / Apr 04, 2011 5:33am

    Kreativ

    16 posts

    Would it be possible to send HTML emails from this form? I would like people to post an invitation to others and the body content to be preset. Sending from Communication with HTML on, it works fine, so this should work as well? Well for the moment I just receive the code. Maybe something wrong I do…?
    http://alturl.com/qodx5

    Thanks again for your support

  • #7 / Apr 05, 2011 8:39am

    John Henry Donovan

    12339 posts

    Kreativ,

    in your Email Configuration you can change the format of the email from plain text to HTML but so far as something more advanced then no there isn’t this functionality

    You may find something on devot-ee.com though

  • #8 / Apr 07, 2011 8:42pm

    Kreativ

    16 posts

    Yes, I understand. I don’t need more advanced, just want to make sure the contact_form can send in HTML.
    The Communicate works fine sending HTML, but not the contact_form - is that an issue with my EE 1.7? Should I be able to use HTML in contact_form if I choose it from CP › System Preferences › Email Configuration › Default Mail Format › HTML?

  • #9 / Apr 08, 2011 11:27am

    Sue Crocker

    26054 posts

    Hi, Kreativ. The basic contact form won’t work with HTML. As John mentioned, you might be able to find something over on Devot-ee.com.

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

ExpressionEngine News!

#eecms, #events, #releases