• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 6. Sending Email from a Web Form > Writing the Code to Send a Message

Writing the Code to Send a Message

In this task, you'll create a page that sends an email message to your email address. The content of the message will be hard-coded initially. That is, if you send yourself 20 messages, they'll all have the same subject and body content. Once you have verified that it works, you can build a front-end form for it and change the hard-coded values to dynamic form values.

Open generic_template.asp, choose File > Save As, and name the new file messageSent.asp.

This new file will do the work of generating and sending the email message and will inform the user that the message has been sent.

Replace the placeholder title with Message Sent. Replace the placeholder body text with Your message has been sent. You should hear from us within two days. Insert a new paragraph with the text, Return to Newland Home, and link the word Home to index.asp.

You can see the payoff for having created the template already. The new page literally takes seconds to create and customize, as it will appear to the user.

What's lacking at this point is the functionality that will generate and send the email. Before dealing with this issue, let's pause for a moment to discuss objects. Many modern computer languages—including most languages used for Web programming—contain them, so it's a good concept to master.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint