%
Option Explicit
Dim strBody, strResponse, strFrom, strEmail
'////////////////////////////////////////////////////////////
' MODIFY VALUES BETWEEN "QUOTES" BELOW TO CHANGE OUTPUT OF EMAIL
'////////////////////////////////////////////////////////////
CONST DOMAIN_NAME = "anglingunlimited.com"
CONST EMAIL_TO_NAME = "Tom OHaus"
CONST EMAIL_TO = "info@anglingunlimited.com"
CONST EMAIL_OWNER = "tomohaus@aol.com"
CONST EMAIL_COOWNER = "ChuckMcNamee@aol.com"
CONST EMAIL_SUBJECT = "Angling Unlimited Reservations Request"
CONST EMAIL_FROM_NAME = "Website Visitor"
CONST EMAIL_FROM_ADDRESS= "info@anglingunlimited.com"
CONST EMAIL_REMOTE_HOST = "sendmail.brinkster.com"
CONST EMAIL_WEBMASTER = "anglingunlimited@aol.com"
CONST EMAIL_MAILSERVERUSERNAME ="webmailer@anglingunlimited.com"
CONST EMAIL_MAILSERVERPASSWORD = "cornwhiskey"
CONST EMAIL_MAILFROM_ADDRESS= "webmailer@anglingunlimited.com"
'////////////////////////////////////////////////////////////
'DO NOT MODIFY BELOW THIS LINE
strEmail = Request.Form("EMAIL")
If Len(strEmail)<>0 Then
strBody = BuildBody()
strFrom = strEmail
strResponse = MailIt(strBody,strEmail,strFrom,EMAIL_SUBJECT)
Response.Clear
Response.Redirect "thankyou.asp?msg=" & Server.URLEncode(strResponse)
End if
Function BuildBody()
Dim objItem, strBody, strHeader, strFooter
strHeader = "Reservation Request From " & Request.ServerVariables("SERVER_NAME") & vbcrlf & vbcrlf
strHeader = strHeader & vbTab & "Sent by: " & vbtab & vbtab & strEmail & vbcrlf & vbcrlf
strHeader = strHeader & vbTab & "Sent: " & vbtab & vbtab & FormatDateTime(Now(),0) & " (EST)" & vbcrlf & vbcrlf
strBody = strBody & "Form information entered by Web User" & vbcrlf
strBody = strBody & String(40,"-") & vbcrlf
strBody = strBody & "Contact Information:" & vbcrlf
strBody = strBody & Request.Form("NAME") & vbcrlf
strBody = strBody & Request.Form("ADDRESS1") & vbcrlf
strBody = strBody & Request.Form("ADDRESS2") & vbcrlf
strBody = strBody & Request.Form("CITY") & ", " & Request.Form("STATE") & " " & Request.Form("ZIP") & vbcrlf
strBody = strBody & Request.Form("COUNTRY") & vbcrlf
strBody = strBody & "Phone: " & Request.Form("PHONE") & vbcrlf
strBody = strBody & "Fax: " & Request.Form("FAX") & vbcrlf
strBody = strBody & "Please Contact via " & Request.Form("CONTACT_BY") & vbcrlf & vbcrlf
strBody = strBody & "Reservation Information:" & vbcrlf
strBody = strBody & "Number of People: " & Request.Form("NUMBER_OF_PEOPLE") & vbcrlf
strBody = strBody & "From:" & vbtab & vbTab & Request.Form("FROM_MONTH") & " " & Request.Form("FROM_DAY") & vbcrlf
strBody = strBody & "To:" & vbtab & vbTab & Request.Form("TO_MONTH") & " " & Request.Form("TO_DAY") & vbcrlf
strBody = strBody & "Notes:" & vbcrlf & Request.Form("FEEDBACK") & vbcrlf
strBody = strBody & vbcrlf
strFooter = strFooter & String(40,"-") & vbcrlf
strFooter = strFooter & "Form mail compiled by Works of Wisdom, please email pete@worksofwisdom.com" & vbcrlf & "if problems are encountered."
BuildBody = strHeader & strBody & strFooter
End Function
' mails an email to the site owner, co-owner, and webmaster
Function MailIt(strBody,strFrom,strFromName,strSubject)
Dim objMail, strResponse
Set objMail = Server.CreateObject("JMail.Message")
objMail.MailServerUserName = EMAIL_MAILSERVERUSERNAME
objMail.MailServerPassword = EMAIL_MAILSERVERPASSWORD
objMail.From = EMAIL_MAILFROM_ADDRESS
objMail.AddRecipient EMAIL_OWNER
objMail.AddRecipient EMAIL_COOWNER
objMail.AddRecipient EMAIL_WEBMASTER
objMail.Subject = strSubject
objMail.Body = strBody
if objMail.Send(EMAIL_REMOTE_HOST) then
strResponse = "Thank you for sending mail to us! We shall respond to your request within a couple days."
else
strResponse = "Unfortunately, an error was received when we tried to send an email message. Please email us manually.
" & objMail.Response & "
Click here to send your request manually."
end if
MailIt = strResponse
End Function
%>
|
||||||||
|
||||||||
|
||||||||