[thelist] ASP and form question

Tom Dell'Aringa pixelmech at yahoo.com
Fri Jul 5 15:34:01 CDT 2002


Sharon, below is a copy of what I use for my tell-a-friend - it works
perfectly and always sends me an email:

----

<%@LANGUAGE="VBSCRIPT"%>
<%
strTo = Request.Form("ToEmail")
strFrom = Request.Form("FromEmail")
strSubject = trim(Request.Form("Subject"))
if strSubject = "" then
	strSubject = "Check out this page."
end if
strURL = Trim(Request.Form("URL"))

Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.To = strTo
objCDO.From = strFrom
objCDO.bcc = "you at you.com"
objCDO.Subject = strSubject
objCDO.Body = strFrom & " has recommended that you check out this
page at the DoctorMusic.net web site:"  & VbCrLf & VbCrLf &
Trim(Request.Form("URL")) & VbCrLf & VbCrLf &
Trim(Request.Form("message") & VbCrLf & VbCrLf & VbCrLf& "This page
was sent using our Send-to-friend service. Your email has not been
added to any list, of any sort, and has not been recorded at our
site.")
objCDO.Send
Set objCDO = Nothing

response.redirect strURL
%>

HTH

Tom
--- "Sharon F. Malone" <sfmalo at 24caratdesign.com> wrote:
> Did an ASP file written to send form info to me (as a test) with a
> redirect to a confirmation page. However, I've filled out the form
> twice to test it ... and have not received either email. The
> confirmation page works fine tho.
>
> I notice that the "To" of the objMail.To is blue in my text editor
> as is the "nothing" after setObjMail. This usually indicates
> something isn't right but I don't know what/why.
>
> Any idea why it isn't working?
>
> <%
> Dim objMail
> set objMail = Server.CreateObject("CDONTS.NewMail")
> objMail.From = Request.Form("Order_Info_Form")
> objMail.Subject = "Message from The Chocolate Foundry"
> objMail.To = "sfmalo at 24caratdesign.com"
> objMail.Body  = "Sent by: " & Request.Form("name") & vbCrlf &
> vbCrlf & Request.Form("message")
> objMail.Send
> Response.Redirect("confirm.html")
> set objMail = nothing
> %>
>
> <form name="Order_Info_Form" action="process.asp" method="post"
> enctype="text/plain" onSubmit="return
> Order_Info_Form_Validator(this)"><input type="hidden"
> name="order-orig" value="sfmalo at 24caratdesign.com">
> <input type="hidden" name="order-bcc" value="cheftrain at yahoo.com">
>
---------------------------------------------------------------------------
> Sharon F. Malone
> "web design and Internet writing services"
> http://www.24caratdesign.com
> sfmalo at 24caratdesign.com
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



More information about the thelist mailing list