|





| |

American Autoclave Quote Request Form
|
<%
If Request.Querystring("send") = "True" Then
fmTo="robert@americanautoclave.com"
fmFrom="leon@americanautoclave.com"
fmFromName="AAC Website Inquiry"
fmCC="mrstack@comcast.net"
fmSubject="New Inquiry at the American Autoclave Co. Website"
'fmTo = Trim(Request.Form("fmTo"))
'fmFrom = Trim(Request.Form("fmFrom"))
'fmFromname = Trim(Request.Form("fmFromName"))
'fmCC = Trim(Request.Form("fmCC"))
'fmSubject = Trim(Request.Form("fmSubject"))
' =======================================================
' LEON - ADDED ENTRIES
' =======================================================
fmName = Trim(Request.Form("fmName"))
fmCompany = Trim(Request.Form("fmCompany"))
fmPhone = Trim(Request.Form("fmPhone"))
fmFax = Trim(Request.Form("fmFax"))
fmEmail = Trim(Request.Form("fmEmail"))
fmCity = Trim(Request.Form("fmCity"))
fmState = Trim(Request.Form("fmState"))
fmCountry = Trim(Request.Form("fmCountry"))
fmSource = Trim(Request.Form("fmSource"))
' =======================================================
fmBody = Trim(Request.Form("fmBody"))
Call SendMail(fmTo,fmFrom,fmFromName,fmCC,fmSubject,fmName,fmCompany,fmPhone,fmFax,fmEmail,fmCity,fmState,fmCountry,fmSource,fmBody)
Else
Response.Write("For more information, please complete and submit the form below.
An American Autoclave Representative will follow up with you shortly.")
End If
%>
|
|
|
|
| |
<%
' =======================================================
' LEON - SEND MAIL ROUTINE
' =======================================================
'Begin Routine to Send Mail
Sub SendMail(smTo,smFrom,smFromName,smCC,smSubject,smName,smCompany,smPhone,smFax,smEmail,smCity,smState,smCountry,smSource,smBody)
On Error Resume Next 'To catch any potential errors in the sending
inqBody = "***This is an automated response to your inquiry with American Autoclave Company.***The following is a summary of what you have submitted:" & "- Your Name: " & smName & "
" & "- Company: " & smCompany & "
" & "" & "" & "" & "- Location (City): " & smCity & "
" & "- (State/Province): " & smState & "
" & "- (Country): " & smCountry & "
" & "- Found us through: " & smSource & "
" & "" & "We will respond to your inquiry shortly. In the meantime, if you have any questions or comments, or would just like to drop us a line... We welcome you to contact us at the following: American Autoclave Co. http://www.americanautoclave.com rfstack@comcast.net West Coast: 253-863-5000 East Coast: 706-692-4480 Central States: 425-836-5086 "
emlBody = "An Inquiry has been made at www.americanautoclave.com" & "" & "- Company: " & smCompany & "
" & "" & "" & "" & "- Location (City): " & smCity & "
" & "- (State/Province): " & smState & "
" & "- (Country): " & smCountry & "
" & "- Referred From: " & smSource & "
" & ""
'Response.Write("You should see something following:")
'Response.Write(emlBody)
'Response.Write(smTo)
'Response.Write(smFrom)
'Response.Write(smFromName)
'Response.Write(smCC)
'Response.Write(smSubject)
'Response.Write(smName)
'Response.Write(smCompany)
'Response.Write(smPhone)
'Response.Write(smFax)
'Response.Write(smEmail)
'Response.Write(smCity)
'Response.Write(smState)
'Response.Write(smCountry)
'Response.Write(smSource)
'Response.Write(" <- Before here.")
smCCall = smCC & "; " & "leon@americanautoclave.com" 'This is the list of AAC recipients for the Submitted Inquiry emails
strErr = "" 'Init variable to store any error message
If EmailCheck(smEmail) = False Then
strErr = strErr & "The provided e-mail Address seems to be incorrect."
End If
If Len(smFromName) > 0 Then
smFromage = smFromName & "<" & smFrom & ">"
End If
smSubject = smCompany & " - " & smSubject
' =======================================================
' LEON - FORM HAS PASSED DATA VALIDATION, NOW SEND
' =======================================================
If strErr = "" Then 'If form data has passed basic validation then send
Set iMsg = CreateObject("CDO.Message")
iMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
iMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
iMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iMsg.Configuration.Fields.Update
With iMsg
.To = smTo
.From = smFromage
' If Len(smCC) > 0 Then 'Commented out since we are cc'ing
.CC = smCCall
' End If
.Subject = smSubject
.HTMLBody = emlBody
' .TextBody = smComments
' If Len(smAttach) > 0 Then
' Set iBp = .AddAttachment(smAttach)
' End If
.Send 'SEND MAIL
End With
' =======================================================
' LEON - NOW CLEAN UP AFTER OURSELVES
' =======================================================
'Clean Up
Set iMsg = Nothing
Set thnxMsg = CreateObject("CDO.Message")
thnxMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
thnxMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
thnxMsg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
thnxMsg.Configuration.Fields.Update
With thnxMsg
.To = smEmail
.From = "leon@americanautoclave.com"
.Subject = "Thank you for your interest - the American Autoclave Team!"
.HTMLBody = inqBody
.Send 'SEND MAIL
End With
' =======================================================
' LEON - NOW CLEAN UP AFTER OURSELVES
' =======================================================
'Clean Up
Set thnxMsg = Nothing
'If Len(smAttach) > 0 Then 'NOTE: KEPT AS EXAMPLE
'Set iBp = Nothing
'End If
' =======================================================
' LEON - ERROR - SERVER - COMPONENT ERROR MESSAGE
' =======================================================
If Err > 0 Then 'If a server/component error occurred
Response.Write("Mail Not Sent! Error(s) Occurred:")
Response.Write("")
Else 'Success! Mail Sent
Response.Write("Mail Sent! To: American Autoclave Co. on " & FormatDateTime(DateTime,vbLongDate) & " at " & FormatDateTime(DateTime,vbLongTime))
smName = ""
smCompany = ""
smPhone = ""
smFax = ""
smEmail = ""
smCity = ""
smState = ""
smCountry = ""
smSource = ""
smComments = ""
smTo = ""
smFrom = ""
smFromName = ""
smCC = ""
smSubject = ""
smBody = ""
End If
' =======================================================
' LEON - ERROR - DATA - INPUT INCORRECT ERROR MESSAGE
' =======================================================
Else 'Else, Form data incorrect - write out the error(s)
Response.Write(" Mail Not Yet Sent... Please correct the following & Resend:")
Response.Write("
|