Home   Buy Now   Products   Downloads   Support   Resellers   Jobs   Contact   Site Map   Search
Home   Buy Now   Download   Support  
Email Component, SMTP Component, POP3 Component, IMAP Component, bulk mail

Home
Purchase
Upgrade
 
Products
Downloads
 
Support
 Samples
 KB
 Forum
 
Newsletter
 
Customers
 Current List
 Comments
 
Resellers
Jobs
Contact Us
EasyMail.Net Verify Sample Code

Sample Code

Check out the sample code below to see just how easy it is to use the SMTP component of EasyMail .Net Edition.  But don't let the ease of use fool you; the SMTP component is very powerful and packed with features.  The sample code on this page demonstrates the most basic features of  the SMTP component.  Be sure to click on the "Other Samples" tab to find more advanced samples.

C#   VB.Net   Delphi   Other Samples    
Sample Notes
This sample demonstrates the basic functionality of the SMTP component that sends a message in plain text with an attachment.

// Create an EmailMessage object
EmailMessage msgObj = new EmailMessage();

// Specify the from address and display name
msgObj.From.Email="bobj@domain.com";
msgObj.From.Name="Bob Johnson";

// Add a recipient
msgObj.Recipients.Add("jdoe@domain.com", "John Doe", RecipientType.To);

// Specify the subject and message body text
msgObj.Subject="Subject";
msgObj.BodyParts.Add("Message body.", BodyPartFormat.Plain);

// Add an attachment
msgObj.Attachments.Add("c:\\attachment.txt");

// Create the SMTP object using the constructor
// to specify the mail server
SMTP smtpObj = new SMTP("mail.domain.com");

// Send the message
smtpObj.Send(msgObj);

Copy and paste this code to get a jump start!

 



 

 Product Home
 Features
 What's New in 3.0
 Features Added in 2.x
 System.Web.Mail Comparison
 SMTP Component
 Detailed Features
 Sample Code
 POP3 Component
 IMAP4 Component
 Parse Component
 SSL Plug-in
 S/MIME Plug-in
 Documentation
 Pricing / Licensing

©2012Quiksoft Corporation. All rights reserved. Terms of Use, Privacy Statement, Trademarks