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 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. |
Requirements
IIS
Building and Running the Sample
To build and run this sample
Open the solution file, Mailer.sln, in the Visual Studio development environment.
Build the solution. This will also deploy the solution to the local Web server.
Use a Web browser to view http://localhost/mailer/mailsamp.htm.
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