943,866 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1045
  • ASP RSS
Jun 26th, 2009
0

Constructing an A href link in CDO

Expand Post »
Hi Guys

I am trying to send a link in an email to my users - I am using CDO. I am having trouble contructing the link. Currently I am receiving the message "syntax error".

ASP Syntax (Toggle Plain Text)
  1. strBody = strBody & <a name= & "anchor" & id= & (rsEmailAlert.Fields.Item("S_Id").value) & href= & " http://www.hair-salons.com/Hair-Salon-Search.asp" & > & "CLICK HERE" & </a> & vbCrLf

Any help would be great
Similar Threads
Reputation Points: 11
Solved Threads: 0
Light Poster
whisper_101 is offline Offline
25 posts
since May 2008
Jun 29th, 2009
0

Re: Constructing an A href link in CDO

Hi Guys

ASP Syntax (Toggle Plain Text)
  1. strBody = strBody & <a name= & "anchor" & id= & (rsEmailAlert.Fields.Item("S_Id").value) & href= & " http://www.hair-salons.com/Hair-Salon-Search.asp" & > & "CLICK HERE" & </a> & vbCrLf

Any help would be great
Your Code should look like this:
ASP Syntax (Toggle Plain Text)
  1. strBody = strBody & "<a name=" & anchor & " id=" & (rsEmailAlert.Fields.Item("S_Id").value) & " href='http://www.hair-salons.com/Hair-Salon-Search.asp'>Click Here</a>" & vbCrLf

This should work. Let me know if it doesn't.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jsvanc is offline Offline
18 posts
since Jun 2009
Jun 29th, 2009
0

Re: Constructing an A href link in CDO

Hi

Thanks for your reply.

The email is sent ok but the link appears like this:

<a name= id=1 href='http://www.hair-salons.com/Hair-Salon-Search.asp'>Click Here</a>

At the moment the <a name> is empty and I was hoping the link might appear in the email like this:

Click Here

..
Reputation Points: 11
Solved Threads: 0
Light Poster
whisper_101 is offline Offline
25 posts
since May 2008
Jun 30th, 2009
0

Re: Constructing an A href link in CDO

It sounds like you are sending mail using text format. Make sure that you include this in your script:

ASP Syntax (Toggle Plain Text)
  1. myMail.BodyFormat = 0
  2. myMail.MailFormat = 0

Also, is the name supposed to equal "anchor" or is "anchor" a variable that should = something else?

If name=anchor then use this code:

ASP Syntax (Toggle Plain Text)
  1. strBody = strBody & "<a name='anchor' id='" & (rsEmailAlert.Fields.Item("S_Id").value) & "' href='http://www.hair-salons.com/Hair-Salon-Search.asp'>Click Here</a>" & vbCrLf

Hope this helps.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jsvanc is offline Offline
18 posts
since Jun 2009
Jun 30th, 2009
1

Re: Constructing an A href link in CDO

Works well - Thanks for all your help.
Reputation Points: 11
Solved Threads: 0
Light Poster
whisper_101 is offline Offline
25 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Duplicating Ranking System
Next Thread in ASP Forum Timeline: Passes variable when button is clicked...HELP!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC