email source

Discussion in 'HTML' started by Geoff, Mar 12, 2007.

  1. Geoff

    Geoff Guest

    I have a simple HTML form, one of the Input boxes invites the sender to
    enter their email address. Is there a way that I can copy their email
    address into either the From line or the Subject line of the email being
    sent to me? The idea being to make it easier to find individuals emails
    at a later date.

    Thanks in advance,

    Geoff.
     
    Geoff, Mar 12, 2007
    #1
    1. Advertising

  2. Geoff wrote:
    > I have a simple HTML form, one of the Input boxes invites the sender to
    > enter their email address. Is there a way that I can copy their email
    > address into either the From line or the Subject line of the email being
    > sent to me? The idea being to make it easier to find individuals emails
    > at a later date.


    Yes, that is the job of the server-side that is receiving data from this
    form, validating and then sending the email to you, right? You don't
    have a "mailto:" in the form's ACTION do you?

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 12, 2007
    #2
    1. Advertising

  3. Geoff

    Geoff Guest

    "Jonathan N. Little" <> wrote in message
    news:e078d$45f599c7$40cba785$...
    > Geoff wrote:
    >> I have a simple HTML form, one of the Input boxes invites the sender to
    >> enter their email address. Is there a way that I can copy their email
    >> address into either the From line or the Subject line of the email being
    >> sent to me? The idea being to make it easier to find individuals
    >> emails at a later date.

    >
    > Yes, that is the job of the server-side that is receiving data from this
    > form, validating and then sending the email to you, right? You don't have
    > a "mailto:" in the form's ACTION do you?
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > LITTLE WORKS STUDIO
    > http://www.LittleWorksStudio.com


    Thanks Jonathan, I don't have "mailto", I have:

    <FORM METHOD="POST" ACTION="/common-cgi/fmail">
    <INPUT TYPE="hidden" NAME="recipient" VALUE=>
    <INPUT TYPE="hidden" NAME="subject" VALUE="Contact form">
    <INPUT TYPE="hidden" NAME="email" VALUE="">

    Later on, I have
    <input type="text" name="Email" size="47">
    It is the contents of this text box, where the visitor has entered their
    email address, that I want to appear in the "From" or "Subject" line of
    the emailed form sent to me.

    At the moment, when I receive an email, it has
    From:
    Subject: Contact form

    I hope I have made myself clear.

    Thanks,

    Geoff
     
    Geoff, Mar 13, 2007
    #3
  4. Geoff wrote:
    > "Jonathan N. Little" <> wrote in message
    > news:e078d$45f599c7$40cba785$...
    >> Geoff wrote:
    >>> I have a simple HTML form, one of the Input boxes invites the sender to
    >>> enter their email address. Is there a way that I can copy their email
    >>> address into either the From line or the Subject line of the email being
    >>> sent to me? The idea being to make it easier to find individuals
    >>> emails at a later date.

    >> Yes, that is the job of the server-side that is receiving data from this
    >> form, validating and then sending the email to you, right? You don't have
    >> a "mailto:" in the form's ACTION do you?
    >>
    >> --
    >> Take care,
    >>
    >> Jonathan
    >> -------------------
    >> LITTLE WORKS STUDIO
    >> http://www.LittleWorksStudio.com

    >
    > Thanks Jonathan, I don't have "mailto", I have:
    >
    > <FORM METHOD="POST" ACTION="/common-cgi/fmail">
    > <INPUT TYPE="hidden" NAME="recipient" VALUE=>


    First off *DO NOT* put your destination "recipient" email publicly in
    your html form!! It will not be *if* but *will* be hacked and used to
    relay spam and do all sorts of damage! Put your destination in your CGI
    'fmail' script as a constant so it cannot be changed.

    > <INPUT TYPE="hidden" NAME="subject" VALUE="Contact form">
    > <INPUT TYPE="hidden" NAME="email" VALUE="">
    >
    > Later on, I have
    > <input type="text" name="Email" size="47">
    > It is the contents of this text box, where the visitor has entered their
    > email address, that I want to appear in the "From" or "Subject" line of
    > the emailed form sent to me.
    >
    > At the moment, when I receive an email, it has
    > From:
    > Subject: Contact form
    >
    > I hope I have made myself clear.
    >


    Next I am assuming you are using the CGI.pm, so grab the email value

    my $from_unclean = param('email');

    # Use some function to insure a valid safe email value!!!
    my $from_clean = myFunctionToValidateEmail($from_unclean);


    # Then append to your 'clean' subject line value

    $subject_clean .= " - $from_clean";

    #then add to your mail header as normal


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Mar 13, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter
    Replies:
    0
    Views:
    3,428
    Peter
    Jul 1, 2003
  2. John Silver
    Replies:
    0
    Views:
    634
    John Silver
    Feb 4, 2005
  3. Tee

    Email ErrorPage to email

    Tee, Jun 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    397
  4. Replies:
    3
    Views:
    569
    AdamM
    Jul 27, 2004
  5. Chuck Amadi
    Replies:
    2
    Views:
    421
    chuck amadi
    Jun 6, 2004
Loading...

Share This Page