Solved

CDO.Message

Posted on 2003-10-30
7
65,392 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
[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
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
Independent Software Vendors: 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!

 
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

Technology Partners: 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

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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