?
Solved

Sending variable values in CDO mail form

Posted on 2006-05-31
4
Medium Priority
?
247 Views
Last Modified: 2008-02-01
I am having trouble with CDO email forms.  I wish to send an email to the client alerting them an application has been made, I wish this email to include a message as well as variable values and a hyperlink. The problem is sending the variable values see below:      

objCDOMail.HTMLBody = "An application to an event has been posted.<br>To go straight to the application form and view the details <a href='http://www.hushclothing.co.uk/caukus.asp?appID=" + userID + "'>Click Here/a><br><br>Thank You<br><br>Caukus Alert Application System"


      
0
Comment
Question by:rabbits2
  • 2
4 Comments
 
LVL 8

Assisted Solution

by:NovoNordisk
NovoNordisk earned 500 total points
ID: 16802280
objCDOMail.HTMLBody = "An application to an event has been posted.<br>To go straight to the application form and view the details <a href='http://www.hushclothing.co.uk/caukus.asp?appID=" &userID&"' >Click Here/a><br><br>Thank You<br><br>Caukus Alert Application System"
0
 
LVL 6

Accepted Solution

by:
inviser earned 500 total points
ID: 16802351
What NovoNordisk posted has the correct idea. That is that the double quotes around the href= statement are interfering with the quotes surrounding the entire literal string you are assigning objCDOMail.HTMLBody. You can either use single quotes as you see above, no quotes (since there are no spaces in the URL), or use 2 consecutive double quotes ("" is interpreted by ASP as a literal ") like this:

objCDOMail.HTMLBody = "An application to an event has been posted.<br>To go straight to the application form and view the details <a href=""http://www.hushclothing.co.uk/caukus.asp?appID=" & userID & """>Click Here</a><br><br>Thank You<br><br>Caukus Alert Application System"

NOTE: In your code and NovoNordisk's code the closing </a> tag was missing the '<' bracket (this is fixed in the code I posted). Also, in ASP you use the & operator to concatenate strings, not the + operator.
0
 
LVL 8

Expert Comment

by:NovoNordisk
ID: 16802407
oops - well spotted!
0
 

Author Comment

by:rabbits2
ID: 16803357
Thats working , thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question