Problem when sending email in Visual Studio 2005 Professional Edition. Please help!

Discussion in 'ASP .Net' started by bienwell, Oct 17, 2006.

  1. bienwell

    bienwell Guest

    Hi all,

    I've tried this code in Visual Studio 2005 Professional Edition to send
    email. It didn't cause any errors, but didn't make any actions. The
    Imports System.Net.mail is the object in this program. FromEmail and
    Servername are variables in this code.


    Dim mm As New MailMessage()
    mm.From = New MailAddress(FromEmail)

    mm.To.Add(Email_Address)

    mm.Subject = subject

    mm.Body = Msg



    Dim smtp As New SmtpClient(ServerName)

    smtp.Send(mm)



    Anything wrong in this code ? Please advise. Thank you very much.
     
    bienwell, Oct 17, 2006
    #1
    1. Advertising

  2. bienwell

    Mark Rae Guest

    "bienwell" <> wrote in message
    news:...

    > Anything wrong in this code?


    There's nothing intrinsically wrong with the code, but there may not be
    enough of it... :)

    Does your mail server require authentication?
    See here for further details: http://www.systemnetmail.com
     
    Mark Rae, Oct 17, 2006
    #2
    1. Advertising

  3. bienwell

    sloan Guest

    Check my blog:
    Even if you don't download/use the code provided, it helps you understand
    the authentication models.



    http://sholliday.spaces.live.com/blog/ 2/8/2006 ENTRY DATE




    Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)
    "bienwell" <> wrote in message
    news:...
    >
    > Hi all,
    >
    > I've tried this code in Visual Studio 2005 Professional Edition to send
    > email. It didn't cause any errors, but didn't make any actions. The
    > Imports System.Net.mail is the object in this program. FromEmail and
    > Servername are variables in this code.
    >
    >
    > Dim mm As New MailMessage()
    > mm.From = New MailAddress(FromEmail)
    >
    > mm.To.Add(Email_Address)
    >
    > mm.Subject = subject
    >
    > mm.Body = Msg
    >
    >
    >
    > Dim smtp As New SmtpClient(ServerName)
    >
    > smtp.Send(mm)
    >
    >
    >
    > Anything wrong in this code ? Please advise. Thank you very much.
    >
    >
    >
    >
    >
    >
     
    sloan, Oct 17, 2006
    #3
  4. bienwell

    bienwell Guest

    Hi,

    This code worked fine. My problem was .NET framework 1.1 and 2.0 were
    installed in the same server and it took version 1.1 as default. It has
    nothing to do with authentication.

    Thanks a lot.

    "Mark Rae" <> wrote in message
    news:...
    > "bienwell" <> wrote in message
    > news:...
    >
    >> Anything wrong in this code?

    >
    > There's nothing intrinsically wrong with the code, but there may not be
    > enough of it... :)
    >
    > Does your mail server require authentication?
    > See here for further details: http://www.systemnetmail.com
    >
     
    bienwell, Oct 18, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jmd
    Replies:
    1
    Views:
    579
  2. jd1978
    Replies:
    2
    Views:
    2,187
    jd1978
    Feb 8, 2006
  3. rockdale
    Replies:
    1
    Views:
    651
    Juan T. Llibre
    Aug 23, 2006
  4. hunkgym
    Replies:
    1
    Views:
    2,002
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 30, 2006
  5. John Crews
    Replies:
    8
    Views:
    799
    John Crews
    May 23, 2009
Loading...

Share This Page