Hi,
I am converting a 1.1 code to 2.0
The line that I would like to convert is
System.Web.Mail.SmtpMail.SmtpServer = SMTPserverName;
P.S. using outlook
do you know what should this line be in 2.0 ?
Thanks
Printable View
Hi,
I am converting a 1.1 code to 2.0
The line that I would like to convert is
System.Web.Mail.SmtpMail.SmtpServer = SMTPserverName;
P.S. using outlook
do you know what should this line be in 2.0 ?
Thanks
.NET 2.0 uses System.Net.Mail, but it does have some differences to System.Web.Mail. I suggest that you read about the namespace and its members first, rather than just jumping in and using it and assuming it will work as you expect.
In 2.0, it's like this. You'll notice the differences yourself when compared to 1.1.
VB Code:
Dim sc As SmtpClient = New SmtpClient("smtpservername") Dim from As MailAddress = New MailAddress(fromAddress, fromName) Dim to As MailAddress = New MailAddress(toAddress, toName) Dim msg As MailMessage = New MailMessage(from,to) msg.Subject = "Onions are evil." msg.Body = "Beware the onions." sc.Send(msg)
problem solved.
Thanks