Prob using "Style" in HTML Body of Email
I have the following HTML code in a VB5 program sending an Email that "does not" work:
Code:
.Subject = MsgSubject
.HtmlBody = "<html><body style='background-color:FFFF99'>" _
& HtmlBodyFirstPart _
& "</br></br><p2 style=""font-family:arial;color:red;font-size:20px;"">HAPPY BIRTHDAY!</p2>" _
I have the following code that "does" work:
Code:
.Subject = MsgSubject
.HtmlBody = "<html><body style='background-color:FFFF99'>" _
& HtmlBodyFirstPart _
& "</br></br><p2><font size='7' color='red' face='arial'>HAPPY BIRTHDAY!</font></p2>" _
What is wrong with the code using "Style"????
Thanks for your help
Re: Prob using "Style" in HTML Body of Email
Probably because you're styling a non-existent tag. There's no such thing as <p2>.
Re: Prob using "Style" in HTML Body of Email
Quote:
Originally Posted by
DexterRose
I have the following HTML code in a VB5 program sending an Email that "does not" work:
Code:
.Subject = MsgSubject
.HtmlBody = "<html><body style='background-color:FFFF99'>" _
& HtmlBodyFirstPart _
& "</br></br><p2 style=""font-family:arial;color:red;font-size:20px;"">HAPPY BIRTHDAY!</p2>" _
I would suggest you use Three ( 3 ) of these : ", like this :
Code:
.Subject = MsgSubject
.HtmlBody = "<html><body style='background-color:FFFF99'>" _
& HtmlBodyFirstPart _
& "</br></br><p2 style="""font-family:arial;color:red;font-size:20px;""">HAPPY BIRTHDAY!</p2>"
That hsould work. The problem is when you do this :
It closes the existing string and starts a new one!
Yeah, what is P2 by the way?? Does that even work??
Re: Prob using "Style" in HTML Body of Email
Ah, good catch Hannes! I missed that.
Or you can use single quotes just like you are in the example you provided that does work.
Re: Prob using "Style" in HTML Body of Email
You guessed it! I'm new to HTML. Thanks for the tip!
It's amazing what happens when you use the correct format.
Thanks
Re: Prob using "Style" in HTML Body of Email
Always glad to help :)
Please remember to mark your thread resolved.