Solved

CDO Email from .ASP Put Hyperlink in HTMLBody

Posted on 2003-12-02
5
1,116 Views
Last Modified: 2008-02-01
This should be simple.  I'm using CDO to send email messages to our staff when a user submits a form via ASP, it sends an email to their manager and tells them to go to a page to review.  I'd like to include in the body of the email a hyperlink to the page they use to update the data.  I can't seem to get it correct.  The message sends fine, but I haven't been successful putting a hyperlink in the message body.  

Any suggestions?

Thanks as always !

0
Comment
Question by:BetsyV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 4

Expert Comment

by:ainapure
ID: 9861940
please post the code u have so far

-amit
0
 
LVL 20

Expert Comment

by:jitganguly
ID: 9862034
You have to use bodyformat=0

Here is a sample from MSDN

Try putting hyperlink here and see

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
 
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & ""content=""text/html; charset=iso-8859-1"">""
HTML = HTML & "<title>Sample NewMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "This is a sample message being sent using HTML. <BR></body>"
HTML = HTML & "</html>"
 
myMail.From = "Example@microsoft.com"
myMail.To = "Someone@microsoft.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing
0
 

Assisted Solution

by:kkkani
kkkani earned 125 total points
ID: 9862165
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title></title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=#FFFFFF>"
HTML = HTML & "<a href=www.yahoo.com>Click Here</a>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
mail_type = 0


Dim objNewMail
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.From = "test@test.com"
objNewMail.To =  "test@microsoft.com"
objNewMail.Subject = "test"
objNewMail.BodyFormat = 0
objNewMail.MailFormat = 0
objNewMail.Body = HTML
objNewMail.Send
Set objNewMail = Nothing
0
 
LVL 1

Accepted Solution

by:
Jimby_Aus earned 125 total points
ID: 9865034
You may prefer to use CDO/CDOSYS as opposed to the outdated CDONTS library.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_imessage_interface.asp

Just make sure you use the

.HTMLBody

Property, not the .TextBody.
Regards,

Jimby_Aus.
0
 

Author Comment

by:BetsyV
ID: 9867244
Thanks as always.  I am using CDO/CDOSYS, but I had the format to my hyperlink wrong (it had quotes around it <a href=".....">.  That messed everything up.  I split the points because I got the correct format from one message, and knew I had the rest correct based on the suggestion to use .HTMLBody.

I should have put a sample of my code in my original message.  That would have made it more obvious.

Thanks for the help !
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide Table in merge 3 53
Debugging Html 8 43
Record locking on classic ASP 3 64
Can't select treeview node from iframe 2 54
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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