%
SUB sendmail( fromWho, toWho, Subject, Body, toWhoName )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "relay-hosting.secureserver.net"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
' comment this out to STOP sending attachment
'objCDO.AddAttachment "d:\webs\ampacc\test.doc"
objCDO.TextBody = Body
objCDO.Send
END SUB
' *************************************************************
' *************************************************************
SUB sendmail2( fromWhoName, toWhoName, Subject2, Body2 )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "relay-hosting.secureserver.net"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = fromWho
objCDO.Subject = Subject2
objCDO.TextBody = Body2
objCDO.Send
END SUB
' senders company name
Comments = TRIM( Request.Form( "comments") )
' recipients phone
Phone = TRIM( Request.Form( "phone") )
' reciptients upcoming events
UpComingEvents = TRIM( Request.Form( "upcoming_events") )
' senders news
News = TRIM( Request.Form( "news") )
' senders off lease equipkment
OffLeaseEquipment = TRIM( Request.Form( "off_lease_equipment") )
' sender email
fromWho = TRIM( Request.Form( "your_email") )
' recipients email
toWho = TRIM( Request.Form( "recipt_email") )
' reciptients name
toWhoName = TRIM( Request.Form( "recipt_name") )
' senders name
fromWhoName = TRIM( Request.Form( "your_name") )
' recipients email subject
Subject = "Fredastaire Dance Studio"
' email subject
Subject2 = "E-mail Sign-Up"
' text sent to recipient
Body = vbcrlf & "Thank You: " & toWhoName & vbcrlf & vbcrlf & "" & vbcrlf & vbcrlf & UpComingEvents & vbcrlf & News & vbcrlf & OffLeaseEquipment & vbcrlf & vbcrlf & "We hope to see you soon on the dance floor! " & vbcrlf & "Bill Ranell - Owner " & vbcrlf & "www.fredastairesj.com " & " " & vbcrlf & vbcrlf & " " & vbcrlf & vbcrlf & " "& vbcrlf & " " & vbcrlf & " " & vbcrlf & " " & vbcrlf & " " & vbcrlf & " " & vbcrlf & " " & vbcrlf & " "
' text sent to sender
Body2 = "The following information was submitted by: " & vbcrlf & vbcrlf & "Name: " & toWhoName & vbcrlf & "Email: " & toWho & vbcrlf & "Comments: " & comments & vbcrlf & "Phone: " & Phone & vbcrlf & vbcrlf & vbcrlf &" " & vbcrlf & vbcrlf & UpComingEvents & vbcrlf & News & vbcrlf & OffLeaseEquipment
If toWho <> "" THEN
' gets attachment
sendmail fromWho, toWho, Subject, Body, toWhoName
' goes to ampacc
sendmail2 fromWhoName, toWhoName, Subject2, Body2
'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
Dim msgConfirm
msgConfirm = "
| Your request has been sent. |
"
' Any existing page can be used for the response redirect method
END IF
%>
Fredastaire Dance Studio