Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - asp, cdosys errors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

asp, cdosys errors

 Post Reply Post Reply Page  12>
Author
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Jono View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jono Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post 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!)
Back to Top
Jono View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jono Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2008 at 7:23pm
Hi,
 
Gave you the wrong, but similar function. You may wish to try URLEncode (see: http://msdn.microsoft.com/en-us/library/ms525738.aspx)
 
Jono
Back to Top
Jono View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jono Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2008 at 7:32pm
Originally posted by Dan H 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?
 
Can you try a simple URL e.g. "http://domain.com/page.asp?a=" & a
 
Also, looks like cookies need to be defined when creating the object: http://msdn.microsoft.com/en-us/library/ms527024(EXCHG.10).aspx
 
 
Jono


Edited by Jono - 17 July 2008 at 7:37pm
Back to Top
Dan H View Drop Down
Newbie
Newbie


Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan H Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.