How to use System.Net.Mail.SmtpClient via SSL and Authentication?

Discussion in 'ASP .Net' started by =?Utf-8?B?SG90UVE=?=, May 6, 2005.

  1. Below is my code, and is just blocked there. There is no any error message.

    '=============================================>
    Dim msg As String = "---"
    Try
    Dim strFrom As String = ""
    Dim sm As New SmtpClient(Host, Port)
    With sm
    .EnableSsl = True
    .Credentials = New NetworkCredential("MyuserName", "MyPass")
    End With

    Dim _from As MailAddress = New MailAddress(str)
    Dim _to As MailAddress = New MailAddress(str)
    Dim mMsg As New MailMessage(_from, _to)
    mMsg.Subject = "Happy AAA"
    'mMsg.SubjectEncoding = System.Text.Encoding.UTF8

    sm.Send(mMsg)

    msg = "Seccess!"
    Catch ex As Exception
    msg = ex.Message
    End Try

    TextBox1.Text = msg

    '<<=================================================

    Thanks for any suggestion.
     
    =?Utf-8?B?SG90UVE=?=, May 6, 2005
    #1
    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. Replies:
    3
    Views:
    1,180
  2. mazdotnet

    ASP 2.0 Net.Mail.SmtpClient Delay

    mazdotnet, May 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,289
    sloan
    May 9, 2006
  3. refv8
    Replies:
    2
    Views:
    27,081
    ittower
    Oct 13, 2006
  4. Guest

    System.Net.Mail.SmtpClient

    Guest, Sep 15, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    15,169
    Steven Cheng[MSFT]
    Sep 18, 2006
  5. headware

    SmtpClient and Mail Servers

    headware, Jun 24, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    344
    headware
    Jun 25, 2009
Loading...

Share This Page