I've made small class to sent email using the system.net.mail namespace and
it is really slow. any ideas why i'm having such a performance hit?
it seems to work much better when i don't use authentication, however, it's
very slow when i do use it.
******************
Imports Microsoft.VisualBasic
Imports System.Net
Imports System.Net.Mail
Public Class emailhelper
Sub sendmail(ByVal emailto As String, ByVal emailfrom As String, ByVal
emailfromname As String, ByVal body As String, ByVal subject As String)
Dim Msg As MailMessage = New MailMessage()
Dim MailObj As New
SmtpClient(ConfigurationManager.AppSettings("SmtpS erver"))
MailObj.UseDefaultCredentials = False
MailObj.Credentials = New
Net.NetworkCredential("em*********@test.com", "password")
MailObj.DeliveryMethod = SmtpDeliveryMethod.Network
Msg.From = New MailAddress(emailfrom, emailfromname)
Msg.To.Add(New MailAddress(emailto))
Msg.IsBodyHtml = "True"
Msg.Body = body
Msg.Subject = subject
MailObj.Send(Msg)
End Sub
End Class