Solved

CDO Email from .ASP Put Hyperlink in HTMLBody

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

20 Experts available now in Live!

Get 1:1 Help Now