Click here to Skip to main content
14,639,480 members
Rate this:
Please Sign up or sign in to vote.
See more:
Protected Sub btnSumbit_Click(sender As Object, e As System.EventArgs) Handles btnSumbit.Click
            'Dim mailMessage As MailMessage = New MailMessage(New MailAddress(""), New MailAddress(txtEmail.Text.Trim()))
            Dim mailMessage As MailMessage = New MailMessage(New MailAddress(""), New MailAddress(txtEmail.Text.Trim()))
            mailMessage.Subject = "Contact-Us Vacation"
            mailMessage.IsBodyHtml = True

            Dim path As String = Server.MapPath("CareerMail.html").ToString()

            Dim objReader As StreamReader = IO.File.OpenText(path)
            Dim Message As String = objReader.ReadToEnd()

            Message = Message.Replace("[[FirstName]]", txtName.Text)

            mailMessage.Body = Message
            Dim objSMTPClient As New System.Net.Mail.SmtpClient("", 25)
            objSMTPClient.Credentials = New NetworkCredential("", "xxxxxxxxxx")
            objSMTPClient.Timeout = 20000
            objSMTPClient.DeliveryMethod = SmtpDeliveryMethod.Network

            Dim mailMessage1 As MailMessage = New MailMessage(New MailAddress(txtEmail.Text.Trim()), New MailAddress(""))
            mailMessage1.Subject = "Request for ContactUs GoGoaVacation"
            mailMessage1.IsBodyHtml = True

            mailMessage1.Body = "One Person made an inquiry,<br> Inquiry Details are as follows <br> Person Name " & txtName.Text & " From -"

            Dim objSMTPClient1 As New System.Net.Mail.SmtpClient("", 21)
            objSMTPClient.Credentials = New NetworkCredential("", "xxxxxxxxxx")
            'objSMTPClient1.Credentials = CredentialCache.DefaultNetworkCredentials
            objSMTPClient1.DeliveryMethod = SmtpDeliveryMethod.Network

            'lblMsg.Text = "Thank you and we will revert to you soon."

        Catch ex As Exception
        End Try
    End Sub</br></br>
Updated 8-Oct-14 9:06am
[no name] 8-Oct-14 12:15pm
Was there some sort of a question or description of a problem mixed in with your unformatted-hard-to-read code dump?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100