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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

html text formating when submitting email

Status
Not open for further replies.

carranz

Technical User
Nov 17, 2006
40
0
0
US
I have a small problem I have an email script that sends out an email.
everytime I submit the script some of the fonts change or I would get different characters in the email. it never consistent. Not sure why its doing this.

I'm using HTMLBody to create the message. Any help would be appreciated.


objMessage.HTMLBody = "Approval System" & "<br>" & "Access Request Form" & "<hr COLOR=#FF0000>" & "I. Name and Contact Information:" & "<br>" & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Full Name:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & fullname & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Name.#:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" &"&nbsp;" & name1 & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Coll:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & Collx & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Department:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & depart & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Email:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & email & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Phone:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & Phone & "<br>" & "<br>" & "<b><FONT FACE=Verdana SIZE=2>ECA Roles:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "<FONT FACE=Verdana SIZE=2>(IN) Initiator:</FONT>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & chk1 & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" &"&nbsp;" & "<FONT FACE=Verdana SIZE=2>(CM)Committee Member:</FONT>" & "&nbsp;" & "&nbsp;" & chk2 & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "<FONT FACE=Verdana SIZE=2>(CHRDIR) Cha:</FONT>" & "&nbsp;" & "&nbsp;" & chk3 & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "<FONT FACE=Verdana SIZE=2>(ADM) Admin:</FONT>" & "&nbsp;" & "&nbsp;" & chk4 & "<br>" & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Comments:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & message & "<hr COLOR=#FF0000>" & "<br>" & "II. Name and Contact Information:" & "<br>" & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Full Name:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & fullnametxt & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Name.#:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" &"&nbsp;" & name1txt & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Coll:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & Colltxt & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Depart:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & deptxt & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Em:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & emtxt & "<br>" & "<b><FONT FACE=Verdana SIZE=2>Ph:</FONT></b>" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & "&nbsp;" & Phtxt
 
I&nbsp;would&nbsp;like&nbsp;to&nbsp;help&nbsp;but &nbsp;your&nbsp;code&nbsp;is&nbsp;completely&nbsp; unreadable.&nbsp;&nbsp;Do&nbsp;you&nbsp;think&nbsp;you&nbsp; could&nbsp;help&nbsp;us&nbsp;out&nbsp;by&nbsp;showing&nbsp; only&nbsp;a&nbsp;portion&nbsp;of&nbsp;the&nbsp;code&nbsp;that &nbsp;produces&nbsp;these&nbsp;errors?

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Why are you using ampersands (&) to concatenate? Are you sure you are using Javascript? Maybe you are doing this using some other scripting environment?

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
It's VBA code of some sort.

Do the fonts actually change or are some of them simply default fonts?
What does View Source in the actual email look like?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Sorry to respond so late. I was not at work yesterday.
I'm not using javascript. I'm using ASP (vbscript) to send the email. But I use the HTMLBody to format the email. So I can use font size, font type,color and spacing. I also put variables in the HTMLBody.

If I don't use the &nbsp to creat space. what other tag or useful method I can use to create spacing.
 
CSS is not effective in many mail clients.
Better to stick with old skool HTML and perhaps some simple inline CSS here and there where email is concerned.

Better still. Just send plain text email.

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top