TOGGIT - IN SEARCH OF CERTIFICATION
 TOGGIT
     IN SEARCH OF CERTIFICATION
    
     
  
TOGGIT IN SEARCH OF CERTIFICATION

Visual Basic .Net Sample Code and Applications

MAIN
Logon to ToggIT
Join ToggIT
Home
Home
Contact Us
Career Building
Certification Maps
Partners
Technopedia
.Net Source Code
Free Networking Tools
Free IT Publications
Microsoft
2003 Certifications
270 Win XP Pro
290 2003 Server
291 2003 Network Inf
293 Plan Network inf
294 2003 Active Directory
224 Exchange 2000
DBA Certifications
228 SQL 2000
229 SQL 2000
MCSD Certifications
526 Windows Apps
305 ASP.NET
2000 Certifications
210 Professional
215 Server
216 Network inf.
217 Directory Svc.
218 Managing 2K
219 Design Dir Svc.
220 Design Security
270 Win XP Pro
221 Design Net Inf.
Cisco
CCNA
CompTia
A+ Hardware 2003!
A+ Software 2003!
Network+
Security+
New Wireless
CWNP program
Java 
Java Goodies 



MCSE Top-Rated Sites



 

Join Toggit Now!
Avoid Annoying Ads!

 Your Email:

 New Password:

See the list of .Net articles
How to send an email in Microsoft Visual Basic .Net

Are you working with Microsoft Visual Basic .NET? We have put together some code samples to answer some common "How to" questions.
 

Sending Mail Using Dot net


The System.Web.Mail namespace provides the classes for sending Email in Dot net.

MailMessage is the class primarily used to Manage the mail message contents. SmtpMail is the class used to do the sending. The following block of code can send a test e-mail.

Note: The account context of the code must have the right to send mail on the SMTP server.
 


Dim myMail As System.Web.Mail.SmtpMail
Dim Mailmsg As New System.Web.Mail.MailMessage
myMail .SmtpServer = "mail.YourMail.com"
Mailmsg.To = "Target@Email.com"
Mailmsg.From = "\Your Name\ <You@yourMail.com>"
Mailmsg.BodyFormat = System.Web.Mail.MailFormat.Html
Mailmsg.Subject = "A test email"
Mailmsg.Body = "This is only a test"
myMail.Send(Mailmsg)

 

 
The Properties of the MailMessage class:

Attachment - Specifies the list of the attachments that are transmitted with the message

Bcc - A list of semicolon delimited email addresses that receive a Blind Carbon Copy of the message

Body - Contains the message text that has to be sent.

BodyEncoding - The encoding type of the email message.

BodyFormat - Defines the content type of the body of the message

Cc - A list of semicolon delimited email addresses that receive a Carbon Copy of the message

From - The email address of the sender.

Header - Specifies the custom headers which are transmitted with the Message

Priority - The priority of the email message

Subject - Subject Line of the email message.

To - email address of the recipient.

Other helpful classes:

MailAttachments - Manage the mail attachment.

SmtpMail - Send email to the mail server.


Study and Research resources:
Microsoft Certification Info:
 
See the list of .Net articles

 

TOGGIT      IN SEARCH OF CERTIFICATION

All information on this site is copyright ToggIT.com unless otherwise specified. Material submitted or posted this site may also contain materials that are copyrights of individual contributors. It is illegal to copy, publish, reproduce, or distribute any materials from this site with the express permission of the owner of this material.

The material on this web site is not sponsored by, endorsed by or affiliated with Microsoft, Inc, CompTIA, or Cisco Systems, Inc. Microsoft, Inc.® ,Windows XP, Windows 2000, Windows 2000 Server, Windows 98, Windows NT, Visual Basic, Visual C++, Visual FoxPro, SQL server and Microsoft logos are trademarks or registered trademarks of Microsoft,  Inc. in the United States and certain other countries. A+, Server+, and Network+ are all registered trademarks of CompTIA. CCNA, CCNE, and the Cisco logo are all registered trademarks of Cisco Systems. All other trademarks are trademarks of their respective owners.