Solved

CDO Email from .ASP Put Hyperlink in HTMLBody

Posted on 2003-12-02
5
1,103 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
5 Comments
 
LVL 4

Expert Comment

by:ainapure
Comment Utility
please post the code u have so far

-amit
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now