email source

G

Geoff

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.
 
J

Jonathan N. Little

Geoff said:
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?
 
G

Geoff

Jonathan N. Little said:
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?

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

<FORM METHOD="POST" ACTION="/common-cgi/fmail">
<INPUT TYPE="hidden" NAME="recipient" [email protected]>
<INPUT TYPE="hidden" NAME="subject" VALUE="Contact form">
<INPUT TYPE="hidden" NAME="email" VALUE="(e-mail address removed)">

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: (e-mail address removed)
Subject: Contact form

I hope I have made myself clear.

Thanks,

Geoff
 
J

Jonathan N. Little

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

<FORM METHOD="POST" ACTION="/common-cgi/fmail">
<INPUT TYPE="hidden" NAME="recipient" [email protected]>

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="(e-mail address removed)">

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: (e-mail address removed)
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top