Isaac
asked on
CDO.Message
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
setting the .TextBody of CDOSYS will always send the email as text.
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></ht ml>"
End With
FtB
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></ht
End With
FtB
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!!
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!!
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("CDONT S.NEWMAIL" )
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.Body = bodyTxt
objSendMail.send
Cheers!!
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("CDONT
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.Body = bodyTxt
objSendMail.send
Cheers!!
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*
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*
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("CDONT
objSendMail.Subject = "Your Certificate"
objSendMail.MailFormat = 0
objSendMail.BodyFormat = 0
objSendMail.From = "iola"
objSendMail.To = emailHere
objSendMail.TextBody = bodyTxt
objSendMail.send
Cheers!!