mfisher_jr has asked for the wisdom of the Perl Monks concerning the following question:

Greetings.

At our site we want to send some of our users the calendar of events that they have added to the site. So, my plan was to send them an html email containing text fields so that they could modify their data and submit it back to us.

I've gotten as for as sending a sample html email by doing the following:

my $message = MIME::Lite->new( From => 'our address', To => 'their address', Subject => $email_subject, Type => "text/html", Encoding => '7bit', Data => $email_text); $message->send;

where the $email_text is:

<html><title>Testing</title> <body> <p> <b>bolded text</b> </p> <form method="post" action="htt://www.oursite/cgi-bin/collect_email.pl"> <input type="text" name="testing" value="stuff" /> <input type="submit" name="submit" value="update" /> </form> </body></html>

And that works fine. The email shows a text field with the text stuff in it. However; when that field is changed and the submit button is clicked, the collect_email.pl is not executed.

I'm using a yahoo mail account and instead of executing the collect_email.pl, I have to log in to some yahoo site. Now I know someone have figured this out. One of the email newsletters that I receive has a subscribe field in the email to contain an address. When you hit the subscribe button, one of their pl cgis is excecuted. This works for them even though I am receiving their email through my yahoo account.

Has anyone done what I am trying to do ?

Thanks,
Marty

Replies are listed 'Best First'.
Re: post form from email ?
by dave_the_m (Monsignor) on May 28, 2004 at 18:14 UTC
    If you're really determined to send HTML email, then make sure the URL in the form action begins http: rather than htt: like you have above.

    Dave.

Re: post form from email ?
by ambrus (Abbot) on May 28, 2004 at 18:15 UTC
    action="htt://www.oursite/cgi-bin/collect_email.pl" ^
    You must mean http or https, not htt.
      Thanks for the spell check; that did the trick. How sad to be triped up by a 'p'.

      Marty

Re: post form from email ?
by hardburn (Abbot) on May 28, 2004 at 18:00 UTC

    Don't send HTML mail. Send them a link where they can find a proper form.

    ----
    send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

      Could you give me more info or send me to some page about preferring a link to a form vs. a form in a email ? Thanks, Marty

        No link as such, but I discard all incoming HTML emails unread, I'm sure I'm not alone.

        Steve
        ---
        steve.org.uk

      I don't think you can make such a statement without knowing the application or target audience. This may indeed be the best way in this instance.

      Or it may not be. Perhaps suggest that a link to a form is included in a separate text MIME attachement for users unable to view HTML in email. But to blanket ban HTML in email seems a little extreme.

      Another suggestion might also be to allow user's to set their own email preferences so that they can choose to receive plain text emails if they prefer.

      Just my .02

      cLive ;-)

        As a new person to this area of the web, I am interested in what is the downside of including form data in an email (aside from inability of the user or agent to handle it).

        Thanks,
        Marty