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
        Try
            'Dim mailMessage As MailMessage = New MailMessage(New MailAddress("xxxxxxx@gmail.com"), New MailAddress(txtEmail.Text.Trim()))
            Dim mailMessage As MailMessage = New MailMessage(New MailAddress("xxxxxxx@yahoo.co.in"), 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()

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

            mailMessage.Body = Message
            'Response.Write(Message)
            Dim objSMTPClient As New System.Net.Mail.SmtpClient("100.100.100.100", 25)
            objSMTPClient.Credentials = New NetworkCredential("xxxxxxx@gmail.com", "xxxxxxxxxx")
            objSMTPClient.Timeout = 20000
            objSMTPClient.DeliveryMethod = SmtpDeliveryMethod.Network
            objSMTPClient.Send(mailMessage)

            Dim mailMessage1 As MailMessage = New MailMessage(New MailAddress(txtEmail.Text.Trim()), New MailAddress("xxxxxx@yahoo.co.in"))
            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 - Vacation.com"

            'Response.Write(mailMessage1)
            Dim objSMTPClient1 As New System.Net.Mail.SmtpClient("100.100.100.100", 21)
            objSMTPClient.Credentials = New NetworkCredential("xxxxxxxx@gmail.com", "xxxxxxxxxx")
            'objSMTPClient1.Credentials = CredentialCache.DefaultNetworkCredentials
            objSMTPClient1.DeliveryMethod = SmtpDeliveryMethod.Network
            objSMTPClient1.Send(mailMessage1)

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

        Catch ex As Exception
            Response.Write(ex.ToString)
        End Try
    End Sub</br></br>
Posted
Updated 8-Oct-14 9:06am
v2
Comments
[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