Imports System.Data.OleDb Imports System Imports System.Collections Imports System.ComponentModel Imports System.Data Imports System.Data.SqlClient Imports System.Drawing Imports System.Web Imports System.Web.SessionState Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.TableRow Imports System.Web.UI.WebControls.TreeView Imports System.Web.UI.HtmlControls Imports System.Net.Mail Imports System.IO Partial Class Dementia_and_Forgetfulness Inherits System.Web.UI.Page Function IsValids() As Boolean ' Dim sql As String IsValids = True invmsg.Text = "" If Request.Form("FName") = "" Then InvMsg.Text = "Contact Name cannot be blank" InvMsg.Visible = True IsValids = False End If If Request.Form("Mobile") = "" Then InvMsg.Text = InvMsg.Text & "
Mobile cannot be blank" InvMsg.Visible = True IsValids = False End If If Request.Form("EmailAddress") = "" Then InvMsg.Text = InvMsg.Text & "
Email cannot be blank" InvMsg.Visible = True IsValids = False End If If Request.Form("Comments") = "" Then InvMsg.Text = InvMsg.Text & "
Comments cannot be blank" InvMsg.Visible = True IsValids = False End If ' response.write ("isvalid") If IsValids = False Then Exit Function End If IsValids = True ' response.write ("isvalid true") End Function Private Sub SendEmail() On Error GoTo ErrHandle Dim msg As New MailMessage ' System.Net.Mail.MailMessage Dim i As Long Dim bodystr As String Dim SmtpMail As New System.Net.Mail.SmtpClient SmtpMail.Host = "mail.bhnhealthcare.com" bodystr = "" bodystr = bodystr & "" ' SmtpMail.Port = 25 msg.To.Add(Request.Form("EmailAddress")) msg.To.Add("eworlds@gmail.com") msg.From = New MailAddress("webmaster@bhnhealthcare.com") msg.Subject = "bhnhealthcare.com Enquiry Form" msg.IsBodyHtml = True msg.Body = bodystr SmtpMail.Credentials = New System.Net.NetworkCredential("webmaster@bhnhealthcare.com", "bhc@123") SmtpMail.Send(msg) msg = Nothing SmtpMail = Nothing bodystr = "
bhnhealthcare.com




bhnhealthcare.com is an online portal for psyhciatry care, home care, elder's care, marriage Counseling, drug rehab & Deaddiction.


" & " Thank You " & Request.Form("FName") & " for your Enquiry .
Our Health Care team will get in touch with you soon.

" bodystr = bodystr & "" bodystr = bodystr & "
bhnhealthcare.com


Following is the Enquiry from Website

" bodystr = bodystr & " " bodystr = bodystr & "
Contact Name:" & Request.Form("fname") & "
Mobile:" & Request.Form("Mobile") & "
Email: " & Request.Form("EmailAddress") & "
Contact No.:" & Request.Form("Comments") & "
" SmtpMail = New System.Net.Mail.SmtpClient SmtpMail.Host = "mail.bhnhealthcare.com" ' send mail to us msg = New System.Net.Mail.MailMessage ' msg.To.Add("info@bhnhealthcare.com") msg.To.Add("eworlds@gmail.com") msg.To.Add("bhnhealthcare@gmail.com") msg.To.Add("care@bhnhealthcare.com") msg.From = New MailAddress("webmaster@bhnhealthcare.com") msg.Subject = "Dementia and Forgetfulness Enquiry From Website" msg.IsBodyHtml = True msg.Body = bodystr SmtpMail.Credentials = New System.Net.NetworkCredential("webmaster@bhnhealthcare.com", "bhc@123") SmtpMail.Send(msg) msg = Nothing Exit Sub ErrHandle: If Err.Number <> 0 Then Response.Write(Err.Number & ":" & Err.Description) 'Resume Next End If End Sub Protected Sub Submit_Click1(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles Submit.Click On Error GoTo ErrHandle Dim SQL As String If IsValids() = False Then Exit Sub End If SendEmail() InvMsg.Text = "Enquiry Submitted" InvMsg.Visible = True Exit Sub ErrHandle: If Err.Number <> 0 Then Response.Write(Err.Description) ' resume next End If End Sub End Class