Solved

CDO.Message

Posted on 2003-10-30
7
65,319 Views
Last Modified: 2012-05-07
bodyTxt = "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"

emailHere = "iola@eecom.com"
Set objSendMail = CreateObject("CDO.Message")
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.TextBody = bodyTxt
objSendMail.send

When the email is sent, the recepient receives the contents of bodyTxt with the HTML tags exactly as you see it above.  Also, the link "Please click here" is not active.

Any solutions.
0
Comment
Question by:Isaac
7 Comments
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9653565
Try

bodyTxt = "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"

emailHere = "iola@eecom.com"
Set objSendMail = Server.CreateObject("CDONTS.NEWMAIL")
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.TextBody = bodyTxt
objSendMail.send

Cheers!!
0
 
LVL 4

Accepted Solution

by:
kblack15217 earned 500 total points
ID: 9653567
if this is really CDO.Message, then you need to change

objSendMail.TextBody to objSendMail.HTMLBody

You dont need the mailformat or body format calls.  Get rid of them.

0
 
LVL 4

Expert Comment

by:kblack15217
ID: 9653573
setting the .TextBody of CDOSYS will always send the email as text.  
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9653577
From Microsoft:

Dim iMsg
Set iMsg = CreateObject("CDO.Message")

With iMsg
  .To         = "someone@microsoft.com"
  .Newsgroups = "comp.microsoft.newsgroup1"
  .Subject    = "Agenda for staff meeting"
  .HTMLBody   = "<html><body><p>Please plan to present your status for the following projects...</p></body></html>"
End With


FtB
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9653580
If you wanna use CDOSYS,
use..
bodyTxt = "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"

Set objSendMail = CreateObject("CDO.Message")

With objSendMail
 .To         = "someone@microsoft.com"
 .Newsgroups = "comp.microsoft.newsgroup1"
 .Subject    = "Agenda for staff meeting"
 .HTMLBody   = bodyTxt
End With


Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9653586
Correction on sending the mail using the NEWMAIL Object.. Here's the correct code.

bodyTxt = "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"

emailHere = "iola@eecom.com"
Set objSendMail = Server.CreateObject("CDONTS.NEWMAIL")
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.Body = bodyTxt
objSendMail.send

Cheers!!
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9653633
TheInnovator:

Perhaps your HTML isn't properly formatted.  Change this:

bodyTxt = "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"

To This:
bodyTxt = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
bodyTxt = bodyTxt & "<html>"
bodyTxt = bodyTxt & "<head>"
bodyTxt = bodyTxt & "<meta http-equiv=""Content-Type"""
bodyTxt = bodyTxt & ""content=""text/html; charset=iso-8859-1"">""
bodyTxt = bodyTxt & "<title>Sample NewMail</title>"
bodyTxt = bodyTxt & "</head>"
bodyTxt = bodyTxt & "<body>"
bodyTxt = bodyTxt & "<span>You have just received an email from security.<br> <a href='http://registration/se/Rest.asp?var=" & request.form("id") & "&email=" & email & "'>Please click here.</a></span>"
bodyTxt = bodyTxt & "</body></html>"

If you want more information, here is a link that says exactly how to do it:
     http://www.15seconds.com/issue/980429.htm


Hope that helps,
Dex*
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

11 Experts available now in Live!

Get 1:1 Help Now