Solved

CDO Email from .ASP Put Hyperlink in HTMLBody

Posted on 2003-12-02
5
1,115 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 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