For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > September 2005 > Email and including a stylesheet









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Email and including a stylesheet
WebBuilder451

2005-09-30, 6:59 pm

i'm sending email via an aspx page. The format is html. Is there a way to
include a link to a stylesheet? I notice that the
Dim mail As New MailMessage
mail.Body = msg
mail.BodyFormat = MailFormat.Html
will create the correct html headers but i can't figure out how to include a
link to a stylesheet in the head tag.
Any ideas?
thanks
kes
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
S. Justin Gengo

2005-09-30, 6:59 pm

When you build out your html use a string builder. Append to the string
builder all the text for a regular html page with a link to a stylesheet
stored out on your website... Otherwise put all the style tags directly in
the text.

Dim MySB AS New System.Text.StringBuilder

With MySB
.Append("<html>" & vbcrlf)
.Append(vbTab & "<head>" & vbcrlf)
.Append(vbTab & vbTab & "<meta [style link here]>" & vbcrlf)
'---Etc.
End With

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
news:FD80860D-3780-4A92-B5D3-59065E51A9BD@microsoft.com...
> i'm sending email via an aspx page. The format is html. Is there a way to
> include a link to a stylesheet? I notice that the
> Dim mail As New MailMessage
> mail.Body = msg
> mail.BodyFormat = MailFormat.Html
> will create the correct html headers but i can't figure out how to include
> a
> link to a stylesheet in the head tag.
> Any ideas?
> thanks
> kes
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes



John MacIntyre

2005-09-30, 6:59 pm


"WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
news:FD80860D-3780-4A92-B5D3-59065E51A9BD@microsoft.com...
> i'm sending email via an aspx page. The format is html. Is there a way to
> include a link to a stylesheet? I notice that the
> Dim mail As New MailMessage
> mail.Body = msg
> mail.BodyFormat = MailFormat.Html
> will create the correct html headers but i can't figure out how to include
> a
> link to a stylesheet in the head tag.
> Any ideas?


This is an untested idea ...

Instead of a css link, have you tried to embed your styles right into the
body of the email? Like you can in an HTML page?

John


WebBuilder451

2005-09-30, 6:59 pm

thanks for responding,

that is an answer, however i was hoping to use the mailmessage object
directly like when you need to add dynamic linkbuttons, or child controls. I
figure the head tag already exists in the mailmessage object (somewhere) so
you should be able to add an <a link ... stylesheet.. /> as a key or somthing.
thanks

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes


"S. Justin Gengo" wrote:

> When you build out your html use a string builder. Append to the string
> builder all the text for a regular html page with a link to a stylesheet
> stored out on your website... Otherwise put all the style tags directly in
> the text.
>
> Dim MySB AS New System.Text.StringBuilder
>
> With MySB
> .Append("<html>" & vbcrlf)
> .Append(vbTab & "<head>" & vbcrlf)
> .Append(vbTab & vbTab & "<meta [style link here]>" & vbcrlf)
> '---Etc.
> End With
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
> news:FD80860D-3780-4A92-B5D3-59065E51A9BD@microsoft.com...
>
>
>

WebBuilder451

2005-09-30, 6:59 pm

thanks for responding
Can do that but can't do that. My designer will kill me, she is very strong
on standardization, which is not a Microsoft srong point. this means style
elements should be in style sheets not in-line.
Seeing as how we are married, hey you get the idea!!!!

but thanks
kes
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes


"John MacIntyre" wrote:

>
> "WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
> news:FD80860D-3780-4A92-B5D3-59065E51A9BD@microsoft.com...
>
> This is an untested idea ...
>
> Instead of a css link, have you tried to embed your styles right into the
> body of the email? Like you can in an HTML page?
>
> John
>
>
>

S. Justin Gengo

2005-09-30, 6:59 pm

That's true of a web page. But this isn't a web page is it? I would ask her
if she can point out the standardization that says there should be a
separate style sheet for an email message.

If you need a place to sleep afterward my couch is free and I have beer in
the fridge. Just be quiet so you don't wake up my wife and our five year
old. I have nowhere to go myself! :)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
news:CCC712CE-8D24-4123-9653-CAFE107AFA7D@microsoft.com...[color=darkred]
> thanks for responding
> Can do that but can't do that. My designer will kill me, she is very
> strong
> on standardization, which is not a Microsoft srong point. this means style
> elements should be in style sheets not in-line.
> Seeing as how we are married, hey you get the idea!!!!
>
> but thanks
> kes
> --
> thanks (as always)
> some day i''m gona pay this forum back for all the help i''m getting
> kes
>
>
> "John MacIntyre" wrote:
>


WebBuilder451

2005-09-30, 6:59 pm

I'll talk to her and be ready to pay you some of the rent.
thanks
kes
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes


"S. Justin Gengo" wrote:

> That's true of a web page. But this isn't a web page is it? I would ask her
> if she can point out the standardization that says there should be a
> separate style sheet for an email message.
>
> If you need a place to sleep afterward my couch is free and I have beer in
> the fridge. Just be quiet so you don't wake up my wife and our five year
> old. I have nowhere to go myself! :)
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "WebBuilder451" <WebBuilder451@discussions.microsoft.com> wrote in message
> news:CCC712CE-8D24-4123-9653-CAFE107AFA7D@microsoft.com...
>
>
>

jack.murphy@jkn.com

2005-09-30, 6:59 pm

S. Justin,

I agree to that.

My company just developed the world's first and only web-based
"web-page emailer" available at www.jkn.com

You would be amazed to know how much hurdles we had to go through to
get web pages to fit inside of an email so that it will display
properly in all email clients (even web-based ones like Hotmail and
Yahoo Mail)

CSS is only a small part of it. We had a major issue with framesets.
Even Internet Explorer can't email frameset-based web pages. But I am
proud to say that we can at www.jkn.com

Regards,

Jack Murphy

Juan T. Llibre

2005-09-30, 6:59 pm

Very nice site/concept, Jack.

Congratulations!



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espaņol : http://asp.net.do/foros/
======================================
<jack.murphy@jkn.com> wrote in message
news:1128097781.426442.240950@g49g2000cwa.googlegroups.com...
> S. Justin,
>
> I agree to that.
>
> My company just developed the world's first and only web-based
> "web-page emailer" available at www.jkn.com
>
> You would be amazed to know how much hurdles we had to go through to
> get web pages to fit inside of an email so that it will display
> properly in all email clients (even web-based ones like Hotmail and
> Yahoo Mail)
>
> CSS is only a small part of it. We had a major issue with framesets.
> Even Internet Explorer can't email frameset-based web pages. But I am
> proud to say that we can at www.jkn.com
>
> Regards,
>
> Jack Murphy



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com