Script that sends email to text box value

C

C. David Rossen

Hello:

I am looking for a script that will send an email to whatever address is
entered into the text box. I usually use formmail.pl, but with that, the
recipient is a hidden field and is specified in the html code. I want to use
that, but I want the email to also be sent to the address that is entered in
the email text box. Any help would be greatly appreciated. Thanks.

David
 
G

Gunnar Hjalmarsson

C. David Rossen said:
I am looking for a script that will send an email to whatever address is
entered into the text box. I usually use formmail.pl, but with that, the
recipient is a hidden field and is specified in the html code. I want to use
that, but I want the email to also be sent to the address that is entered in
the email text box.

Even if this is not the right place to look for ready-to-go scripts, I
can't help notice that the CPAN module CGI::ContactForm meets your
somewhat vague specification.

http://www.gunnar.cc/contactform/readme.html
 
M

Martin Kissner

C. David Rossen wrote :
Hello:

I am looking for a script that will send an email to whatever address is
entered into the text box. I usually use formmail.pl, but with that, the
recipient is a hidden field and is specified in the html code. I want to use
that, but I want the email to also be sent to the address that is entered in
the email text box. Any help would be greatly appreciated. Thanks.

There are several modules on CPAN to support sending mail i. e.
Mail::Internet

HTH
Martin
 
S

Scott Bryce

C. David Rossen said:
I am looking for a script that will send an email to whatever address is
entered into the text box. I usually use formmail.pl, but with that, the
recipient is a hidden field and is specified in the html code. I want to use
that, but I want the email to also be sent to the address that is entered in
the email text box. Any help would be greatly appreciated. Thanks.

My apologies if I'm wandering off topic, but doesn't that create an open
relay? It seems that a spammer could exploit the script and use it to
send spam through your mail server.
 
T

Tad McClellan

C. David Rossen said:
I am looking for a script


We discuss *writing* programs here.

Are you having trouble writing a Perl program that does what you want?

I usually use formmail.pl,

Gulp.


I want to use
that,


Bad, bad idea!

Any help would be greatly appreciated.


This is more helpful than you are likely to realize:

Don't use Matt's formmail.pl !
 
G

Gunnar Hjalmarsson

Scott said:
My apologies if I'm wandering off topic, but doesn't that create an open
relay? It seems that a spammer could exploit the script and use it to
send spam through your mail server.

I pointed the OP to a module I wrote which does just that, and I believe
the keyword is "also". A message sent via the module goes both to a
pre-destinated recipient and the entered address (which normally is the
real sender...). That, together with the fact that the originating IP
address is stated in one of the message headers, should reasonably make
the module unattractive for spamming.

Actually, the reason I wrote CGI::ContactForm was to make it more
difficult for spammers (it allows you to very easily replace
mailto-links with contact forms), and I'm convinced it serves that
purpose. During the two years the module has been available I have never
heard of any occurrence of abusing it for spamming.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top