Double Quotes Problem

E

Evertjan.

Ice Man wrote on 19 sep 2003 in microsoft.public.inetserver.asp.general:
I got a "double quote" problem when I try to give a background color
for the html page
txtMailBody = "<html bgcolor="#FFCC33">"

txtMailBody = "<html bgcolor='#FFCC33'>"

Can bgcolor be a attribute of the <html> tag, however?
 
I

Ice Man

Hi

I want to send e-mails using an asp page
first I create the mail Object: Set objMail =
Server.CreateObject("CDONTS.NewMail")

After I fill a variable with the html code that will be the mail

txtMailBody = "<html>"
txtMailBody = txtMailBody & "<center>Hi <BR> This is a test"
txtMailBody = txtMailBody & "</html>"

finally I send the mail using the following code:
objMail.Body = txtMailBody
objMail.Send

I got a "double quote" problem when I try to give a background color for the
html page
txtMailBody = "<html bgcolor="#FFCC33">"

Is there a way to accomplish this

Thanks for all
 
A

Adrienne

Ice Man wrote on 19 sep 2003 in microsoft.public.inetserver.asp.general:

txtMailBody = "<html bgcolor='#FFCC33'>"

Can bgcolor be a attribute of the <html> tag, however?

No, it can't. It can be an attribute of the Body element, albeit
depreciated. Best method is to put everything into a style element in the
head element.

txtMailBody = "<html><head><title>Mail Message</title><style type=" & chr
(34) & "text/css" & chr(034) & ">body {background-color:#FFCC33}</style>
</head><body>Email message</body></html>"
 
P

PB4FUN

I got a "double quote" problem when I try to give a background color for the
html page
txtMailBody = "<html bgcolor="#FFCC33">"

The solution for a double quote problem is to double your quotes :

txtMailBody = "<html bgcolor=""#FFCC33"">"

Meindert, MCP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top