Script that sends email to text box value

Discussion in 'Perl Misc' started by C. David Rossen, Mar 20, 2005.

  1. 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
    C. David Rossen, Mar 20, 2005
    #1
    1. Advertising

  2. C. David Rossen wrote:
    > 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

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Mar 20, 2005
    #2
    1. Advertising

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

    --
    perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
    [29,77,98,111,105,29],[100,93,95,103,97,110]];
    for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
    Martin Kissner, Mar 20, 2005
    #3
  4. C. David Rossen

    Scott Bryce Guest

    C. David Rossen wrote:

    > 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.
    Scott Bryce, Mar 21, 2005
    #4
  5. C. David Rossen <> wrote:

    > 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 !


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 21, 2005
    #5
  6. Scott Bryce wrote:
    > C. David Rossen wrote:
    >> 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.

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

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Mar 21, 2005
    #6
    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. JCardinal
    Replies:
    1
    Views:
    2,780
    Guenther Liebowitz
    Aug 14, 2003
  2. Gnarlodious
    Replies:
    4
    Views:
    17,588
    elizas
    May 5, 2010
  3. =?Utf-8?B?Sm9obiBIYWxs?=
    Replies:
    0
    Views:
    448
    =?Utf-8?B?Sm9obiBIYWxs?=
    Jun 10, 2006
  4. Replies:
    2
    Views:
    292
    Scott Roberts
    Dec 21, 2007
  5. pbd22
    Replies:
    1
    Views:
    148
Loading...

Share This Page