Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

emailing a link

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have the following email script that I want to include a link in the body. Here is my script and the current error I am getting. Can someone tell me how to change the bodystring area

if Request.Form("FFSubmitted") = "yes" then
FormFields = ""
If FormFields <> &quot;&quot; Then
arrFormFields = split(FormFields,&quot;~&quot;)
End If
Set objCDO = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDO.From = &quot;timesheet@am1st.com&quot;
objCDO.To = &quot;sthompson@am1st.com&quot;
objCDO.Cc = &quot;&quot;
objCDO.Bcc = &quot;&quot;
objCDO.Subject = &quot;Please Approve this timesheet&quot;
BodyString = &quot;The following user &quot; & ((rs2.Fields.Item(&quot;firstname&quot;).Value) & &quot; &quot; & (rs2.Fields.Item(&quot;lastname&quot;).Value)) & &quot; has submited his information for the health drawnings&quot; & <a href=&quot;maintain.asp&quot;>approve there TimeSheet</a>&quot;
If FormFields <> &quot;&quot; Then
For Each item In arrFormFields
BodyString = BodyString & item & &quot;: &quot; & Request.Form(item) & chr(13)
Next
End If
objCDO.Body = BodyString
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
Set objCDO = Nothing
RedirectURL = &quot;&quot;
If RedirectURL <> &quot;&quot; then
If Request.QueryString <> &quot;&quot; Then
response.redirect(RedirectURL & &quot;?&quot; & Request.QueryString)
else
response.redirect(RedirectURL)
end If
end if
end if
%>

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/am1st/Mystuff/timeemail.asp, line 80, column 181
BodyString = &quot;The following user &quot; & ((rs2.Fields.Item(&quot;firstname&quot;).Value) & &quot; &quot; & (rs2.Fields.Item(&quot;lastname&quot;).Value)) & &quot; has submited his information for the health drawnings&quot; & <a href=&quot;maintain.asp&quot;>approve there TimeSheet</a>&quot;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
 
The double quotes in your string are the most likely culprit. Try using single quotes in your <a href='maintain.asp'> instead of double quotes.
 
adding the single quotes didn't help. I still get a syntax error.
 
Try writing out your string to see if you can see a problem with it:


BodyString = &quot;The following user &quot; & ((rs2.Fields.Item(&quot;firstname&quot;).Value) & &quot; &quot; & (rs2.Fields.Item(&quot;lastname&quot;).Value)) & &quot; has submited his information for the health drawnings&quot; & <a href=&quot;maintain.asp&quot;>approve there TimeSheet</a>&quot;
If FormFields <> &quot;&quot; Then
For Each item In arrFormFields
BodyString = BodyString & item & &quot;: &quot; & Request.Form(item) & chr(13)
Next
End If
Response.write(&quot;String is &quot; & BodyString & &quot;<br>&quot;)
Response.end
 
everything is fine until I try and put HTML in the message. Does CDO mail support HTML messages?
 
What does the string look like when it prints out on your screen?
 
I just saw the rolla site a second of go. that looks like my answer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top