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".

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:)

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

myMail.BodyFormat = 0 
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:

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.

Works well - Thanks for all your help.

commented: great question. +1