|
-
Jan 24th, 2006, 05:47 AM
#1
Thread Starter
Fanatic Member
1.1 to 2.0
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
-
Jan 24th, 2006, 06:42 AM
#2
Re: 1.1 to 2.0
.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.
-
Jan 24th, 2006, 07:09 AM
#3
Re: 1.1 to 2.0
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)
-
Jan 24th, 2006, 07:11 AM
#4
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|