D
Dr. Harvey Waxman
I guess I should change from cdonts to cdosys. Since I am ignorant about asp I
hope you forgive this basic question. There are two asp files for handling
mail, the one that gets the info from a form and creates a form.asp to mail and
the one that takes that file and mails it, mail.asp.
I believe I can figure out what needs to be altered in the code for the first
form.asp but what needs to be changed in the one that sends the email? Is it
just this in the following code and if so just what should it read?
Thanks
Harvey
This is the 'mail.asp' file I use currently with cdonts.
Set objCDO = Server.CreateObject("CDONTS.NewMail")
'change this to the appropriate http
Const strHTTP = "http://www.righttax.org/"
'get current date
strDate = Date()
'get form information
strFormName = Request("FormName")
strSubject = Request("subject")
strSendTo = Request("SendTo")
strName = Request("txtName")
strPhone = Request("txtPhone")
'if no information entered for email use your own
if instr(Request("txtEmail"), "@") <> 0 then
strFrom = Request("txtEmail")
else
strFrom = strSendTo
end if
'concat URL information
strURLInfo = strHTTP & strFormName & "?" & Request.Form()
'create the HTML for email
strHTML = "<HTML> <HEAD> <TITLE></TITLE> </HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<TABLE WIDTH=500 CELLPADDING=0 CELLSPACING=0>"
strHTML = strHTML & "<TR>"
'use some graphics for email
strHTML = strHTML & "<TD><IMG SRC=" & strHTTP & "emailbanner.JPG
BORDER=0></TD>"
strHTML = strHTML & "</TR>"
'include basic info in email
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD>"
strHTML = strHTML & "<BR>Date: " & strDate
strHTML = strHTML & "<BR>Subject: " & strSubject
strHTML = strHTML & "<BR>Requested by: " & strName
strHTML = strHTML & "<BR>Phone: " & strPhone
if strFrom <> strSendTo then
strHTML = strHTML & "<BR>Email: <a href=mailto:" & strFrom & ">" &
strFrom & "</a>"
else
strHTML = strHTML & "<BR>Email: UNKNOWN"
end if
'add hyperlink to form in email
strHTML = strHTML & "<BR><BR>"
strHTML = strHTML & "<A HREF=" & strURLInfo & "><IMG SRC=" & strHTTP &
"form.gif WIDTH=16 HEIGHT=16 BORDER=0>Click here</A>"
strHTML = strHTML & " to view completed form."
strHTML = strHTML & "</TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD></TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "</TABLE>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
'time to send the email
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = strSendTo
objCDO.From = strFrom
objCDO.Subject = strName & " - " & strSubject
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
objCDO.Body = strHTML
objCDO.Send
set objCDO = nothing
'redirect to the "Thanks" page
'Response.Redirect strHTTP & "index.html"
hope you forgive this basic question. There are two asp files for handling
mail, the one that gets the info from a form and creates a form.asp to mail and
the one that takes that file and mails it, mail.asp.
I believe I can figure out what needs to be altered in the code for the first
form.asp but what needs to be changed in the one that sends the email? Is it
just this in the following code and if so just what should it read?
Thanks
Harvey
This is the 'mail.asp' file I use currently with cdonts.
Set objCDO = Server.CreateObject("CDONTS.NewMail")
'change this to the appropriate http
Const strHTTP = "http://www.righttax.org/"
'get current date
strDate = Date()
'get form information
strFormName = Request("FormName")
strSubject = Request("subject")
strSendTo = Request("SendTo")
strName = Request("txtName")
strPhone = Request("txtPhone")
'if no information entered for email use your own
if instr(Request("txtEmail"), "@") <> 0 then
strFrom = Request("txtEmail")
else
strFrom = strSendTo
end if
'concat URL information
strURLInfo = strHTTP & strFormName & "?" & Request.Form()
'create the HTML for email
strHTML = "<HTML> <HEAD> <TITLE></TITLE> </HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<TABLE WIDTH=500 CELLPADDING=0 CELLSPACING=0>"
strHTML = strHTML & "<TR>"
'use some graphics for email
strHTML = strHTML & "<TD><IMG SRC=" & strHTTP & "emailbanner.JPG
BORDER=0></TD>"
strHTML = strHTML & "</TR>"
'include basic info in email
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD>"
strHTML = strHTML & "<BR>Date: " & strDate
strHTML = strHTML & "<BR>Subject: " & strSubject
strHTML = strHTML & "<BR>Requested by: " & strName
strHTML = strHTML & "<BR>Phone: " & strPhone
if strFrom <> strSendTo then
strHTML = strHTML & "<BR>Email: <a href=mailto:" & strFrom & ">" &
strFrom & "</a>"
else
strHTML = strHTML & "<BR>Email: UNKNOWN"
end if
'add hyperlink to form in email
strHTML = strHTML & "<BR><BR>"
strHTML = strHTML & "<A HREF=" & strURLInfo & "><IMG SRC=" & strHTTP &
"form.gif WIDTH=16 HEIGHT=16 BORDER=0>Click here</A>"
strHTML = strHTML & " to view completed form."
strHTML = strHTML & "</TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD></TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "</TABLE>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
'time to send the email
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = strSendTo
objCDO.From = strFrom
objCDO.Subject = strName & " - " & strSubject
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
objCDO.Body = strHTML
objCDO.Send
set objCDO = nothing
'redirect to the "Thanks" page
'Response.Redirect strHTTP & "index.html"