This documentation is archived and is not being maintained.

Mailer Sample: Demonstrates SMTP Mail Classes 

Download sample

Demonstrates the SMTP mail classes provided with ATL Server.

The Mailer sample allows you to fill in a form, attach some files, and send the resulting message through SMTP e-mail.

Security noteSecurity Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

Requirements

  • IIS

Building and Running the Sample

To build and run this sample

  1. Open the solution file, Mailer.sln, in the Visual Studio development environment.

  2. Build the solution. This will also deploy the solution to the local Web server.

  3. Use a Web browser to view http://localhost/mailer/mailsamp.htm.

  4. Compose your message and click Send Message to send the message. The table below describes the fields that allow you to configure the settings for your message:

    Field Description Example Optional

    Server Name

    The SMTP server you are sending to.

    smtp.microsoft.com

    No

    Sender Name

    The friendly name of the sender.

    John Doe

    Yes

    From

    The sender's e-mail address.

    johndoe@microsoft.com

    No

    Recipient Name

    The friendly name of the recipient.

    Jane Doe

    Yes

    To

    The recipient's e-mail address.

    janedoe@microsoft.com

    No

    CC

    The e-mail address(es) of the recipient(s) to get copies of the message. Multiple addresses should be separated by commas, semicolons, or spaces.

    ellen@microsoft.com, frank@microsoft.com

    Yes

    Subject

    The subject of the message.

    Greetings!

    Yes

    Message

    The message body.

    Hi Jane!

    Yes

    Priority

    The priority of your message.

    Normal

    Yes

    File fields

    These fields allow you to attach up to 3 files to your message and choose the encoding scheme.

    file1.txt, file2.txt, file3.txt

    Yes

Demonstrates

See Also

Show: