Reply to Re: email source

Your name:

Reply:


Posted by Jonathan N. Little on 03/13/07 20:51

Geoff wrote:
> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:e078d$45f599c7$40cba785$18302@NAXS.COM...
>> 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=sales@xxxxxxx.com>

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="www@xxxxxx.com">
>
> 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: www@xxxxxxx.com
> 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация