Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS

Status
Not open for further replies.

dhaveedh

Programmer
Aug 13, 2003
112
GB
Hello there!

I am sending the contents of a form to an email address using CDONTS. I want to send it with some formatting so I have to change the Body format oj ObjMail.body to HTML.

I have done all this but when I do send the mail, It comes through with all the HTML tags showing and no formatting is achieved.

Does anyone know whats up here?

Here is a bit of my code.

sBody = sBody & "<Strong>" & Request.form.key(icurrFieldIndex)": </Strong>" & Request.form.key(icurrFieldIndex)

Set objMail = CreateObject("CDONTS.Newmail")
sHTML = "<HTML>"
sHTML = sHTML & "<HEAD>"
sHTML = sHTML & "<TITLE>Bad News!</TITLE>"
sHTML = sHTML & "</HEAD>"
sHTML = sHTML & "<BODY>"
sHTML = sHTML & sbody
sHTML = sHTML & "</BODY></HTML>"

objMail.From = "rob@here.com"
objMail.To = "jdr@there.com"
objMail.BodyFormat = cdoBodyFormatHTML
objMail.Body = sHTML
objMail.Send

Set objMail = Nothing





KISS - Keep It Simple Sugar!
 
'you need TO add these lines FOR the mail
'to be sent in HTML format
.BodyFormat = 0
.MailFormat = 0
 
I have done this but still get the same problem.



KISS - Keep It Simple Sugar!
 
try adding this line too...
Code:
objMail.MailFormat = CdoMailFormatMIME

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
FesterSXS

This is what my suggestion does. cdoMailFormatMine is a constant defined in the adovbs.inc file as

cdoMailFormatMine = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top