Results 1 to 4 of 4

Thread: 1.1 to 2.0

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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:
    1. Dim sc As SmtpClient = New SmtpClient("smtpservername")
    2. Dim from As MailAddress = New MailAddress(fromAddress, fromName)
    3. Dim to As MailAddress = New MailAddress(toAddress, toName)
    4. Dim msg As MailMessage = New MailMessage(from,to)
    5. msg.Subject = "Onions are evil."
    6. msg.Body = "Beware the onions."
    7. sc.Send(msg)

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    Re: 1.1 to 2.0

    problem solved.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width