somethings from codeland

Friday, September 07, 2007

.Net smtp worker

I started working with an array of custom objects that will each contain information to send to either a cell phone or HTML accessible mail client.. This is going to be the base of the class. Just need to construct the interface for the array of custom objects..

smtp .Net mailer class

I ended up having do some SMTP authentication. In order to do this I had to create a custom Credential Cache object to tie to my SMTPClient object for the email request..


//SMTP CREDENTIAL INFORMATION
//set username and pass for smtp authentications
NetworkCredential netLogin = new NetworkCredential(eMail.SMTPLoginName, eMail.SMTPLoginPassword);
//set authenticated smtp connection network configuration credentials
CredentialCache myCache = new CredentialCache();
myCache.Add(eMail.SMTPServerName, Convert.ToInt16(eMail.SMTPPort), "", netLogin);
//assign custom credentials to this authenticated smtp request
client.Credentials = myCache;

No comments:

Twitter Updates

About Me

My photo
I have been working with computers/programming to put myself through college since I graduated high school. I am currently attending Oklahoma State University for bachelors degree in biological sciences. Along with my experience in programming, a degree in biology will allow me to pursue a career in bioinformatics research concerning genetic diseases (i.e. cancer).

Blog Archive