M
Michelle
Hi...
I'm trying to convert a 1.1 application to 2.0. Trying to send email using
code like this:
Dim strTo As String = "(e-mail address removed)"
Dim strFrom As String = "(e-mail address removed)"
Dim strSubject As String = "An information request from" & _ClientName
Dim strBodyContent As String = BodyBuilding()
SmtpMail.SmtpServer = "localhost"
Try
SmtpMail.Send(strFrom, strTo, strSubject, strBodyContent)
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
Visual Studio reports (in the Error List) this:
Warning 1 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended
alternative is System.Net.Mail.SmtpClient.
The method in my code above worked beautifully in 1.1. Questions:
1) why the change in 2.0
and
2) how should I use System.Net.Mail.SmtpClient to send email?
Thanks
I'm trying to convert a 1.1 application to 2.0. Trying to send email using
code like this:
Dim strTo As String = "(e-mail address removed)"
Dim strFrom As String = "(e-mail address removed)"
Dim strSubject As String = "An information request from" & _ClientName
Dim strBodyContent As String = BodyBuilding()
SmtpMail.SmtpServer = "localhost"
Try
SmtpMail.Send(strFrom, strTo, strSubject, strBodyContent)
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
Visual Studio reports (in the Error List) this:
Warning 1 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended
alternative is System.Net.Mail.SmtpClient.
The method in my code above worked beautifully in 1.1. Questions:
1) why the change in 2.0
and
2) how should I use System.Net.Mail.SmtpClient to send email?
Thanks