| Author |
Topic Search Topic Options
|
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Topic: asp, cdosys errors Posted: 16 July 2008 at 5:43pm |
Using cdosys to send email in asp - I need to pass variables in form or querystring on email for link. I pretty much get a variety of errors whenever I attempt to string the variables.
oMail.CreateMHTMLBody "http://yepdata.com/EmailStuff.asp?A=" & AA & "&B=" & BB
This gives me 'unterminated string' errors, and trying to build a form just leaves it speechless.
I also tried to set cookies to hold the variables and sent the page without a querystring, the page showed up - but it never found the cookies. Any thoughts?
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 July 2008 at 7:58pm |
|
It looks okay to me. Do you get the same error if you put the url into a variable first? Or does it need Server.HTMLEncode?
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 July 2008 at 8:16pm |
Thanks for the response.
Yes- I built the string and named it. The error msg was identical.
Server.HTMLEncode? Never heard of it...
How's that work? (Not a .Net thing, right?)
Dan
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 16 July 2008 at 9:53pm |
oMail.CreateMHTMLBody server.HTMLEncode("http://yepdata.com/EmailIStuff.asp?A=" & AA & "&B=" & BB & "&C=" & CC)
didn't work, and about a dozen variations failed as well.
What am I doing wrong here?
Dan
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 July 2008 at 2:16am |
|
Here's a thought - WebWizForums uses code to generate the email notification that a reply has been posted. This has a querystring, and is probably exactly what I'm looking for! Anybody know what the code looks like? (I'm kind of making myself nuts here trying to get this to work!)
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 July 2008 at 7:23pm |
|
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 July 2008 at 7:32pm |
Dan H wrote:
oMail.CreateMHTMLBody "http://yepdata.com/EmailStuff.asp?A=" & AA & "&B=" & BB
This gives me 'unterminated string' errors, and trying to build a form just leaves it speechless.
I also tried to set cookies to hold the variables and sent the page without a querystring, the page showed up - but it never found the cookies. Any thoughts? |
Going back to your original issue, have you performed a response.redirect to the generated URL and does it work?
Jono
Edited by Jono - 17 July 2008 at 7:37pm
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 July 2008 at 11:27pm |
Interesting news!
This works:
<head><title>emailtest</title></head> <body> <%
A=1234 AA= http://yepdata.com/roadwarrior/test.asp?A= & A Set oMail = Server.CreateObject("CDO.Message") Set oMailConfig = Server.CreateObject ("CDO.Configuration") oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 oMailConfig.Fields.Update Set oMail.Configuration = oMailConfig oMail.From = "dan@yepdata.com" oMail.To = "dharr1@cox.net" oMail.Subject = "test page test.asp" oMail.createMHTMLBody AA oMail.Send Set oMail = Nothing Set oMailConfig = Nothing %> </body></html> This code was taken from www.ASPDev.org, and it also seems to support multiple variables in the querystring. The configuration stuff must have made the difference.
Thanks for the help, Jono.
Dan H
|
 |