Click to See Complete Forum and Search --> : Cdont +html


nwbee
05-27-2003, 10:14 AM
Hello,

I want to sent newsletters from my online mailinglist.

I know how to turn html on, but I can only get predefined text to show as html-coded. I also want the body that the user fills in in a form, to show up according to my style sheets.

Can anyone help me?

Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
'hier de html-codes plaatsen
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Sending CDONTS Email Using HTML</title>"
HTML = HTML & "<STYLE>"
HTML = HTML & "BODY {background-color : Black;font : 12px Arial, Helvetica, sans-serif;"
HTML = HTML & "color : #FFFFFF;margin: 40px;line-height: 18px;"
HTML = HTML & "scrollbar-face-color:#297CA6;"
HTML = HTML & "scrollbar-arrow-color:#FFFFFF;scrollbar-track-color:#369CCD;"
HTML = HTML & "scrollbar-shadow-color:#369CCD;scrollbar-highlight-color:#369CCD;"
HTML = HTML & "scrollbar-3dlight-color:#67B5DA;scrollbar-darkshadow-Color:#67B5DA;}"
HTML = HTML & "P {font : 12px Arial, Helvetica, sans-serif;}"
HTML = HTML & "b {font-weight: bold;}"
HTML = HTML & "A {color : #000066;text-decoration: underline;}"
HTML = HTML & "A:hover {color : #CC0033;text-decoration: underline;}"
HTML = HTML & "H1 {font : 12px Arial, Helvetica, sans-serif; font-weight: bold;"
HTML = HTML & "color : #000066;}"
HTML = HTML & "H2 {font : 12px Arial, Helvetica, sans-serif;font-weight: bold;"
HTML = HTML & "color : #369BCD;}"
HTML = HTML & "</head>"
HTML = HTML & "<body>"
HTML = HTML & "<html>"
'set objCDONTS various properties
objCDONTS.From = strFrom
objCDONTS.To = objRS("email")
objCDONTS.Subject = strSubject
objCDONTS.Body = strBody
objCDONTS.BodyFormat=0
objCDONTS.MailFormat=0
objCDONTS.Body=HTML
objCDONTS.Send
Set objCDONTS = Nothing

Ribeyed
05-27-2003, 10:21 AM
hi,
not very sure about what your problem could be, but this line would cause a problem to start with:


HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"


The double quotes would split the sting. You need to replace all double quotes within the first and last one with a single quote

Hope this helps

nwbee
05-27-2003, 11:44 AM
Thanks!

Unfortunately it doesn't help. I did as you said, but still the same problem.

I need the text that comes from:
objCDONTS.Body = strBody

also to take over my css code.

strBody is built up from a form:
strBody = Request.Form("message")

nwbee
05-28-2003, 05:12 AM
Okay, but if I type things in this part:
HTML = HTML & "H2 {font : 12px Arial, Helvetica, sans-serif;font-weight: bold;"
HTML = HTML & "color : #369BCD;}"

it works in outlook express.

But not the part that comes from strBody. So I don't know how to get that in...

nwbee
05-28-2003, 08:23 AM
Great...that worked!

I'm also trying to send two background-images for my table.
Can that be done with cdonts?

I've seen how to attach files, but then my html-background-code doesn't seem to find the files?