Forums
This topic is locked
CDONTS e-mail back to user
Posted 16 May 2003 15:21:05
1
has voted
16 May 2003 15:21:05 David Hagelthorn posted:
Is there a way using CDONTS to send a verification email to the user? It seems that with CDONTS the 'From:' and 'To:' e-mail addresses have to be prefilled... Replies
Replied 16 May 2003 16:29:27
16 May 2003 16:29:27 Dan Berdusco replied:
A verification for what??? If the user has just filled out a form and that is what needs to be verified, then just take the email information that was fill out in the form and put it in the "To" email address. Like this:
<pre id=code><font face=courier size=2 id=code>myMail.To = request.form("Email"</font id=code></pre id=code>
Or you can get the information from a recordset like this:
<pre id=code><font face=courier size=2 id=code>myMail.To = RS_Name.Fields.Item("FieldName".Value</font id=code></pre id=code>
Hope this helps...
<pre id=code><font face=courier size=2 id=code>myMail.To = request.form("Email"</font id=code></pre id=code>
Or you can get the information from a recordset like this:
<pre id=code><font face=courier size=2 id=code>myMail.To = RS_Name.Fields.Item("FieldName".Value</font id=code></pre id=code>
Hope this helps...
Replied 16 May 2003 16:52:25
16 May 2003 16:52:25 David Hagelthorn replied:
By verification I meant confirmation.....I am using the CDONTS extension for DreamweaverMX (www.macromedia.com/cfusion/exchange/index.cfm#loc=en_us&view=sn121&viewName=Dreamweaver%20Extension&extID=304683) which produces this code:
<pre id=code><font face=courier size=2 id=code>
if Request.Form("FFSubmitted" = "yes" then
Dim BodyString
Dim objCDO
Dim RedirectURL
Dim FormFields
Dim arrFormFields
FormFields = "Company Name~Email Address~Password"
If FormFields <> "" Then
arrFormFields = split(FormFields,"~"
End If
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.From = "request.form("Email Address"""
objCDO.To = " "
objCDO.Cc = ""
objCDO.Bcc = ""
objCDO.Subject = ""
BodyString = Replace("~~--// message starts here -->~~","~",chr(13) & chr(10) )& chr(13)
If FormFields <> "" Then
For Each item In arrFormFields
BodyString = BodyString & item & ": " & Request.Form(item) & chr(13)
Next
End If
objCDO.Body = BodyString
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
Set objCDO = Nothing
RedirectURL = "register_submit.asp"
If RedirectURL <> "" then
If Request.QueryString <> "" Then
response.redirect(RedirectURL & "?" & Request.QueryString)
else
response.redirect(RedirectURL)
end If
end if
end if
</font id=code></pre id=code>
It really doesn't like the code: objCDO.From = "request.form("Email Address"""
Any ideas?
<pre id=code><font face=courier size=2 id=code>
if Request.Form("FFSubmitted" = "yes" then
Dim BodyString
Dim objCDO
Dim RedirectURL
Dim FormFields
Dim arrFormFields
FormFields = "Company Name~Email Address~Password"
If FormFields <> "" Then
arrFormFields = split(FormFields,"~"
End If
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.From = "request.form("Email Address"""
objCDO.To = " "
objCDO.Cc = ""
objCDO.Bcc = ""
objCDO.Subject = ""
BodyString = Replace("~~--// message starts here -->~~","~",chr(13) & chr(10) )& chr(13)
If FormFields <> "" Then
For Each item In arrFormFields
BodyString = BodyString & item & ": " & Request.Form(item) & chr(13)
Next
End If
objCDO.Body = BodyString
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
Set objCDO = Nothing
RedirectURL = "register_submit.asp"
If RedirectURL <> "" then
If Request.QueryString <> "" Then
response.redirect(RedirectURL & "?" & Request.QueryString)
else
response.redirect(RedirectURL)
end If
end if
end if
</font id=code></pre id=code>
It really doesn't like the code: objCDO.From = "request.form("Email Address"""
Any ideas?
Replied 16 May 2003 17:32:51
16 May 2003 17:32:51 Dan Berdusco replied:
Don't put quotes around it:
<pre id=code><font face=courier size=2 id=code>objCDO.From = "request.form("Email Address"""</font id=code></pre id=code>
Like this instead:
<pre id=code><font face=courier size=2 id=code>objCDO.From = request.form("Email Address"</font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code>objCDO.From = "request.form("Email Address"""</font id=code></pre id=code>
Like this instead:
<pre id=code><font face=courier size=2 id=code>objCDO.From = request.form("Email Address"</font id=code></pre id=code>