Very New. Help Please

Discussion in 'Programming' started by csweet311, Dec 6, 2009.

  1. #1
    I am very new to Cold Fusion.. I recently installed Adobe CS4 Master Collection.. I just wanna start with a basic CFMail..

    For an example.. Have a textbox where teh user will enter there email and click submit to send it to me. That way i can put them on a mailing list.

    I guess that would be a good start for me... Can anyone help?
     
    csweet311, Dec 6, 2009 IP
  2. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #2
    This can be pretty simple if you like. First start by creating a form with the desired text boxes and textarea to accomadate all the email info.

    Somthing like:
    
    
    Here is the form page code:
    
    <cfform action="action.cfm">
    
      <cfinput type="text" name="from_email"...> the user will enter their email here:
      <textarea name="message"> </textarea>    their meaasge will go here:
     <cfinput type="submit">    this is the submit button:
    </cfform>
    
    
    Code (markup):
    I didn't include all the atributes in every tag. you willneed to finish the rest of them in each tag.

    The action page will include the <cfmail> tag

    
    
    <cfmail from="#form.from_email" to="YOUR_EMAIL_GOES_HERE" subject="STATIC SUBJECT OR DYNAMIC FROM FORM FIELD" type="text/html">
    
    <cfoutput>#form.message#</cfoutput> Heres where the message will show up
    
    </cfmail>
    
    
    Code (markup):
    Theres a lot more you can do and probley should do like validation both on the client side and server side of this script. Do this to ensure that no bad info is passed to the server and possible on to your email.
     
    Last edited: Dec 19, 2009
    unitedlocalbands, Dec 19, 2009 IP