Imports System.Net.Mail
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strnam As String = Trim(Request.Form("name"))
Dim stremail As String = Trim(Request.Form("mail"))
Dim strcom As String = Trim(Request.Form("com"))
Dim strsug As String = Trim(Request.Form("sug"))
Dim Num
Num = Request.ServerVariables("SCRIPT_NAME")
Application.Lock()
Application(Num) = 0
Application(Num) = Application(Num) + 1
Application.UnLock()
If (strnam <> "" And stremail <> "" And strcom <> "" And strsug <> "") Then
Dim ipadd, brow, msgbody
ipadd = Request.ServerVariables("REMOTE_ADDR")
brow = Request.ServerVariables("HTTP_USER_AGENT")
msgbody = "Suggestions: " & strsug & "Comments: " & strcom & _
vbCrLf & "PC info:" & "IP:" & ipadd & "Browser: " & brow & _
"Time:" & Date.Now & "Hits:" & Num & "times!"
'create the mail message
Dim eMail As New System.Net.Mail.MailMessage
'set the addresses
eMail.From = New MailAddress(stremail)
eMail.To.Add("XX")
'set the content
eMail.Subject = "Feedback From:" & strnam
eMail.Body = msgbody
'send the message
Dim smtp_host As New System.Net.Mail.SmtpClient
smtp_host.Host = ("XX")
smtp_host.Port = 25
smtp_host.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtp_host.Credentials = New System.Net.NetworkCredential("XX", "XX")
smtp_host.Send(eMail)
End If
End Sub
End Class
|