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

styling HTML email

Status
Not open for further replies.

Benluke

Technical User
Apr 2, 2004
112
GB
Is it possible to style HTML.

ive been trying to do it using CSS but things aren't working properly.

Is there a different way of doing it.

All i want to do is style text

Thanks for any info

Ben
 
You should be aware that HTML email is not generally a good idea: it is not universally supported (probably because most spam appears in this format), it can be dangerous, and free email servers (such as Hotmail and Yahoo) are notoriously bad at portraying them (I believe that Hotmail cuts off the head section entirely). Do a google search on "html emails" and I'm sure you will get many hits.

That said, how are you sending it?


--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Yes it's possible, but depends on the mail client used to view the mail. Since you cannot control this in most cases it is at least sensible to consider other options.

For CSS to work in an HTML mail you will need to include the CSS in the document rather than linking to it. This will work in most modern mail clients (Lotus Notes is a notable exception).

The pros and cons of HTML emails have been discussed here many times. A quick forum search (or a google search as Chessbot suggests) will help alot.

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
thanks, ive managed to fined out how to style it.

Basically certain things work certain things dont. Keep styles in header and the use of inline text formating works well. this seems to work in hotmail, outlook, yahoo

<style type="text/css">
<!--
a:link {
color: #3399CC;
text-decoration: none;
}

a:visited {
color: #3399CC;
text-decoration: none;
}
a:hover {
color: #3399CC;
text-decoration: underline;
}

-->
</style>
</head>

<body>
<table width="500" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#EBEBEB">
<tr bgcolor="#FFFFFF">
<td height="64" colspan="2"><img src=" alt="Paso Finos Uk" name="mailheader" width="500" height="88" id="mailheader"></td>
</tr>
<tr>
<td height="264" colspan="2" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td width="412" height="24" bgcolor="#E0E0E0"><a href=" size="2" face="Arial, Helvetica, sans-serif"> <td width="84" bgcolor="#E0E0E0"><a href=" src=" alt="Paso Finos UK - Come visit us" name="logo" width="84" height="25" border="0" id="logo"></a></td>
</tr>
<tr>
<td height="21" colspan="2" bgcolor="#FFFFFF"> <p align="center"><font size="1" face="Arial, Helvetica, sans-serif">&copy;
Copyright Paso Finos UK 2004</font></p></td>
</tr>
</table>
 
Basically what im trying to achieve is a template that i can use from outlook ( header / footer) with a gap in the middle to write in.

Its working fine (create mail, insert text from file)but when the emails come into other peoples inbox the two images used come in as attachments.

Is there a way to stop this from happening. Ive noted that html emails that i have received in the past which include images etc, do not include the images as attachments.

Am i doing something wrong?

any advice?

thanks

Ben
 
Basically stationery is a HTML file with onpage/inline CSS.
To set it up create a HTML page with the look you want, set the image as background to the body and use margins to control the message typing area.

If you use <body background="file://localpath to image"> outlook will embed the image when creating the message

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Thanks Chris, ill give it a go later and let you knw how i got on

Thanks again


Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top