I have an email function in a vb.net client application that I’m having
trouble with.
Instead of using the smtpserver that I assign it, it insists on using the
local smtpserver. If I stop the local smtpserver, it will wait until I turn
it back on. It does this even when I run the application from a network
location.
I have tried assigning the remote smtpserver through both: smtpserver =
“smtpserverna me” and smtpserver.inse rt(0,”smtpser vername”).
The from and to seem to be all right, as the process runs successfully thru
the local smtpserver. I have tried different domain values for both from and
to addresses.
try/catch is not catching an error.
Dim email As New System.Web.Mail .MailMessage
email.To = LCase(strTo)
email.From = LCase(strFrom)
email.Subject = Trim(strSubject )
email.Body = Trim(strBody)
Try
System.Web.Mail .SmtpMail.SmtpS erver.Insert(0,
"smtpservername here")
System.Web.Mail .SmtpMail.Send( email)
Catch ex As Exception
‘ error processing here, displays error and innerexception
End Try
I could really use some help here.
thanks.