Workshop

Quiz

1:What does $foo=Net::SMTP->new('mailhost') do?

(If you didn't read the section "A Mail Function for Non-UNIX Systems," you might want to do so now.)

  1. It causes a syntax error.

  2. It creates an object called $foo, which represents a connection to an SMTP mail server.

  3. It includes the Net::SMTP module into the current program.

2:Which of the following is not a (potentially) valid email address?
  1. foo!bar!baz!quux

  2. " "@bar.com

  3. stuff%junk!"Wowzers"!foo.com!blat

Answers

A1: b. If you answered a, then either you've mistyped, or you're running Perl version 4. Choice c is incorrect because it actually describes the statement use Net::SMTP.
A2: Trick question. They're all potentially valid email addresses.

Activities

  • Make these simple changes to the simple CGI mail program:

    • Collect the user's browser information, and attach it to the message body.

    • Send the user a courtesy copy of the message (be sure to tell him or her that you're doing so if you do this on a real Web site). Be careful too, because this can be abused.

  • Allow the user to "preview" the message before sending it. You need to use one of the techniques from Hour 19, "Complex Forms," to make the data from the first page (the email entry screen) available to the second page (the email verification screen) and finally to the mail-sending CGI program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.94.153