Constructing an A href link in CDO

Thread Solved

Join Date: May 2008
Posts: 25
Reputation: whisper_101 is an unknown quantity at this point 
Solved Threads: 0
whisper_101 whisper_101 is offline Offline
Light Poster

Constructing an A href link in CDO

 
0
  #1
Jun 26th, 2009
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".

  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
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 18
Reputation: jsvanc is an unknown quantity at this point 
Solved Threads: 1
jsvanc jsvanc is offline Offline
Newbie Poster

Re: Constructing an A href link in CDO

 
0
  #2
Jun 29th, 2009
Originally Posted by whisper_101 View Post
Hi Guys

  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:
  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.
Hit any user to continue......
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 25
Reputation: whisper_101 is an unknown quantity at this point 
Solved Threads: 0
whisper_101 whisper_101 is offline Offline
Light Poster

Re: Constructing an A href link in CDO

 
0
  #3
Jun 29th, 2009
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

..
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 18
Reputation: jsvanc is an unknown quantity at this point 
Solved Threads: 1
jsvanc jsvanc is offline Offline
Newbie Poster

Re: Constructing an A href link in CDO

 
0
  #4
Jun 30th, 2009
It sounds like you are sending mail using text format. Make sure that you include this in your script:

  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:

  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.
Hit any user to continue......
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 25
Reputation: whisper_101 is an unknown quantity at this point 
Solved Threads: 0
whisper_101 whisper_101 is offline Offline
Light Poster

Re: Constructing an A href link in CDO

 
1
  #5
Jun 30th, 2009
Works well - Thanks for all your help.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC