Link to home
Create AccountLog in
Avatar of craigbtg

asked on

SmtpMail Authentication

Hello, I have an ASP.Net 1.1 application that uses the SMTPMail class to send email through a third party SMTP mail server (GoDaddy).  Everything works correctly, but at times the authentication is very slow and it makes the site appear to hang until the mail message is sent.  Is there anything that can be done to speed up the authentication or make it so the site does not appear to hang, such as send the message  on a separate thread?

My code as it stands is as follows:
MailMessage msg = new MailMessage();
int cdoBasic = 1;
int cdoSendUsingPort = 2;
msg.Fields.Add("", smtpServer);
msg.Fields.Add("", 25);
msg.Fields.Add("", cdoSendUsingPort);
msg.Fields.Add("", cdoBasic);
msg.Fields.Add("", smtpUsername);
msg.Fields.Add("", smtpPassword);
msg.To = sEmail;
msg.From = sFrom;
msg.Subject = sSubject;
msg.Body = sBody;
SmtpMail.SmtpServer = smtpServer;
Avatar of LordWabbit

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of craigbtg


Good suggestion.  Do you happen to know of any pre-built services that already do this kind of polling?
Nope sorry, wrote one for a company a couple years ago, but they were really strict on intellectual property so when I left I shift-deleted any source code I had brought home to work on.