We never stop looking ... ...for a better way

Welcome to Woods Applied Technologies
Saturday, September 04 2010 @ 02:32 AM MDT

Email from .Net

research libraryThis has some info on all .Net versionshttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vb03fxtour.asp

This looks more useful for 2.0 of the framework...
http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx

The primary api ( system.net.mail)
even has its own web portal

http://www.systemnetmail.com/

Story Options

Trackback

Trackback URL for this entry: http://www.watcorp.com/trackback.php?id=20060620193844585

No trackback comments for this entry.
Email from .Net | 1 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Email from .Net
Authored by: cary on Tuesday, June 20 2006 @ 09:49 PM MDT
Sending Email with System.Net.Mail

.NET 2.0 includes much richer Email API support within the System.Net.Mail code namespace. I've seen a few questions from folks wondering about how to get started with it. Here is a simple snippet of how to send an email message from “sender@foo.bar.com” to multiple email recipients (note that the To a CC properties are collections and so can handle multiple address targets):



MailMessage message = new MailMessage();

message.From = new MailAddress("sender@foo.bar.com");



message.To.Add(new MailAddress("recipient1@foo.bar.com"));

message.To.Add(new MailAddress("recipient2@foo.bar.com"));

message.To.Add(new MailAddress("recipient3@foo.bar.com"));



message.CC.Add(new MailAddress("carboncopy@foo.bar.com"));

message.Subject = "This is my subject";

message.Body = "This is the content";



SmtpClient client = new SmtpClient();

client.Send(message);



System.Net.Mail reads SMTP configuration data out of the standard .NET configuration system (so for ASP.NET applications you’d configure this in your application’s web.config file). Here is an example of how to configure it:



<system.net>

<mailSettings>

<smtp from="test@foo.com">

<network host="smtpserver1" port="25" userName="username" password="secret" defaultCredentials="true" />

</smtp>

</mailSettings>

</system.net>