Problem when sending E-mail in VS 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sivahariharan
    New Member
    • Dec 2007
    • 1

    Problem when sending E-mail in VS 2005

    [code=vbnet]
    <summary>
    Sends an mail message
    </summary>
    <param name="from">Sen der address</param>
    <param name="recepient ">Recepient address</param>
    <param name="subject"> Subject of mail message</param>
    Public Shared Sub SendMailMessage (ByVal from As String, ByVal recepient As String, ByVal subject As String)

    Dim mMailMessage As New MailMessage()

    mMailMessage.Fr om = New MailAddress(fro m)

    mMailMessage.To .Add(New MailAddress(rec epient))

    mMailMessage.Su bject = subject

    mMailMessage.Bo dy = "Hai"

    mMailMessage.Is BodyHtml = True

    mMailMessage.Pr iority = MailPriority.No rmal

    Dim mSmtpClient As New SmtpClient("Gur 436smail1.inter globetechnologi es.copm")

    mSmtpClient.Sen d(mMailMessage)

    End Sub



    <summary>

    </summary>
    <param name="sender"></param>
    <param name="e"></param>
    <remarks></remarks>
    Protected Sub BtnSubmit_Click (ByVal sender As Object, ByVal e As System.Web.UI.I mageClickEventA rgs) Handles BtnSubmit.Click

    Try

    objEmployee.fnE mpPersonelInfor mationUpdate()

    Dim strSubject As String = "Username and Password"

    SendMailMessage (Me.txtOMailID1 .Text, Me.txtOMailID2. Text, strSubject)

    Catch ex As Exception

    Throw ex

    End Try 'End of try catch block

    End Sub 'End of BtnSubmit_Click[/code]
    Last edited by Plater; Dec 7 '07, 02:15 PM. Reason: added language to code tag
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What exactly is the error message that you are getting ?

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Why are you using v1.1 code in v2.0? Seems like you copied & pasted from the wrong site.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Indeed, those aren't even the vs2005 XML comment tags.

        Comment

        Working...