Home   Buy Now   Products   Downloads   Support   Resellers   Contact   Site Map  
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
 February 18, 2003  

Volume 1, Issue 2 

Page Navigator: << Back, 1, 2, 3, 4

If your server requires you to authenticate with a user name and password...

If your server will allow you to authenticate with a user name and password, you can configure your application to do so.  We have been using the FreeSMTP.Net classes thus far, however one feature it does not support is SMTP authentication with a user name and password.  For the following example we will use the SMTP class of EasyMail .Net Edition to do the authentication.  EasyMail .Net Edition is the big brother to FreeSMTP.Net.  It can be downloaded here.  The interface is the same as FreeSMTP.Net and is therefore compatible with it.  So if you develop your application with FreeSMTP.Net and then want to add more power or features later, upgrading to EasyMail .Net Edition is a snap.  Here is the code, using EasyMail .Net Edition which does the authentication:

VB Sample		
Quiksoft.EasyMail.SMTP.License.Key = _
   "Put your license key here"
Dim msg As New EmailMessage( _
   "recipient@domain.com", _
   "sender@domain.com", "Subject...", _
   "Message text.", BodyPartFormat.Plain)
Dim smtp As New SMTP()
Dim server As New SMTPServer()
server.Name = "mail.yourdomain.com"
server.AuthMode = SMTPAuthMode.AuthLogin
server.Account = "user"
server.Password = "password"
SMTP.SMTPServers.Add(server)
smtp.Send(msg)
		
C# Sample	
Quiksoft.EasyMail.SMTP.License.Key=
   "Put your license key here";
EmailMessage msg = new EmailMessage(
   "recipient@domain.com",
   "sender@domain.com", "Subject...",
   "Message text.", BodyPartFormat.Plain);
SMTP smtp = new SMTP();
SMTPServer server = new SMTPServer();
server.Name="mail.yourdomain.com";
server.AuthMode=SMTPAuthMode.AuthLogin;
server.Account="user";
server.Password="password";
smtp.SMTPServers.Add(server);
smtp.Send(msg);

The code here is somewhat different to what we have seen in the past.  I want to note that the same code we previously wrote for FreeSMTP.Net will compile and run perfectly with the EasyMail .Net Edition classes.  But for this example, I wanted to change the code a bit to show you some of the advanced capabilities of EasyMail .Net Edition.

The first difference you will notice is the assignment of a LicenseKey property in the first line of code.  EasyMail .Net Edition requires a license key to operate.  You can obtain a trial license key or purchase a permanent one from Quiksoft.  Another item to note is the creation of the SMTPServer object which is added to the SMTPServers collection.  EasyMail .Net Edition enables you to specify an unlimited number of servers for your outgoing message.  This is for backup or failsafe operations.  Each server in the list is tried until the message is sent successfully.  Therefore if your primary mail server is down, the message may still be delivered.  In this example however we have only specified one server.  The AuthMode, Account and Password properties of the SMTPServer class are used to setup the authentication.

EasyMail .Net Edition supports many more features than FreeSMTP.Net or System.Web.Mail.  You can view a comparison here.

Conclusion...

That's really it - it's pretty simple.  Armed with the knowledge I have supplied and the software such as FreeSMTP.Net or EasyMail .Net Edition you will have your .Net applications sending world class e-mail in no time.  In a future edition I will tackle more advanced SMTP topics such as mass mailings, dealing with international character sets, tracking the delivery status of your messages, importing HTML content and more...  If you have suggestions for newsletter material involving any other SMTP issue, please let me know.

 


John Alessi has specialized in e-mail development for the past 6 years and has helped many large companies such as Microsoft, Boeing and EarthLink with their e-mail needs. He can be reached at john@quiksoftcorp.com.

Page Navigator: << Back, 1, 2, 3, 4


In This Issue:

Learn how to send mail from your .Net applications the free and easy way. 

Plus:
Downloadable code to get you started right away


This Issue's Poll:

How do you format the messages sent by your application?

Text only
HTML only
HTML with alternative text
Recipient decides


Signup for this Newsletter:

CRITICAL tips and tricks for e-mail developers


Quiksoft News:

For a limited time, Quiksoft is enabling developers to license the SMTP portion of EasyMail .Net Edition separately.


EasyMail .Net EditionEasyMail .Net Edition
Written in C# and engineered by the leader in e-mail development, EasyMail .Net Edition is the easiest and most reliable way to integrate full-featured e-mail functionality into your .Net apps. Read the comparison for more information.

Buy  Download   Info
 


Customer Comments

"Quiksoft's technical support is excellent. I wish all of our vendors were as responsive and helpful with technical support requests. "

"It paid for itself just after this project."

"I think your product is fantastic. The documentation is clear and consise."

Read More...


E-mail this newsletter to a friend or to yourself:

Unsubscribe...

Printer Friendly Version...

©2003 Quiksoft Corporation. All rights reserved. Unauthorized duplication or distribution prohibited. Quiksoft, EasyMail, EasyMail Objects, EasyMail .Net Edition, EasyMail Advanced API, EasyMail SMTP Express, and MailStore are trademarks of Quiksoft Corporation. Other trademarks mentioned are the property of their legal owner.
©2010 Quiksoft Corporation. All rights reserved. Terms of Use, Privacy Statement, Trademarks