Hi,
Can someone take a look at my source code. I am attempting to create an HTML based email newsletter for my client. It works fine from the URL, but when I email it, I loose all of the formatting.
I'm fairly new at CSS so I'm sure this is the problem.
Thanks
Pat
<!-- m --><a class="postlink" href="http://www.daymarksi.com/newsletteryou">http://www.daymarksi.com/newsletteryou</a><!-- m --> loose all the formatting? did you try a valid doctype as the first line? my email sending program does that by defaultI loose the formatting that I have used pre-defined styles on. In the head, I have created body and paragraph styles that I am using to format the text later in the document.
I don't know how to specify the doc type when I'm sending through e-mail, can you clarify?
ThanksOh, do you mean selecting HTML in the format drop down when sending? If so, my email does that for me.not necessarily. my email program has 3 options, plain text, html, external html. the html option is a GUI editor for an html email. the external option allows me to paste in code that i've created already. the first line in that mode is always a doctype. its the very first line in your code and usually looks something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Are you editing the code in your email program or using a WYSIWYG editor?I am using Front page to create the code.
Thanks.I am using Front page to create the code.That'd be your problem, the code is horrific.Thanks Silverbullet,
I added the doctype and ran it through W3 markup validation for 4.01 transitional, cleaned up all the bad stuff and it works fine now!
The Tree, I'm not sure if you're insulting me or front page for the horrific code?
I'm doing my best to learn how to code better and that's why I'm asking for assistance.
ThanksHi -
Trust me, the insult is for Front Page.
It's a really awful hand to hold for walking you through the learning process...
ElIt doesn't work because you put the CSS in the HEAD. When you send a HTML Email to webmail clients like Gmail, Hotmail, etc., than everything in the HEAD-tags and BODY tags are ignored or removed. Also the doctype you enter is ignored or removed.
So you have to use inline styles instead of embedded styles.
Have a look at Create compatible HTML Email (<!-- m --><a class="postlink" href="http://www.anandgraves.com/redirect/htmlemail.html">http://www.anandgraves.com/redirect/htmlemail.html</a><!-- m -->) .
I have also written a HTML Email Validator (<!-- m --><a class="postlink" href="http://www.anandgraves.com/html-email-validator/">http://www.anandgraves.com/html-email-validator/</a><!-- m -->) . Copy and paste your HTML into the validator and it will report the errors in your code. Each error has a link that referers to the article Create compatible HTML Email (<!-- m --><a class="postlink" href="http://www.anandgraves.com/redirect/htmlemail.html">http://www.anandgraves.com/redirect/htmlemail.html</a><!-- m -->) for more information on the error.
Can someone take a look at my source code. I am attempting to create an HTML based email newsletter for my client. It works fine from the URL, but when I email it, I loose all of the formatting.
I'm fairly new at CSS so I'm sure this is the problem.
Thanks
Pat
<!-- m --><a class="postlink" href="http://www.daymarksi.com/newsletteryou">http://www.daymarksi.com/newsletteryou</a><!-- m --> loose all the formatting? did you try a valid doctype as the first line? my email sending program does that by defaultI loose the formatting that I have used pre-defined styles on. In the head, I have created body and paragraph styles that I am using to format the text later in the document.
I don't know how to specify the doc type when I'm sending through e-mail, can you clarify?
ThanksOh, do you mean selecting HTML in the format drop down when sending? If so, my email does that for me.not necessarily. my email program has 3 options, plain text, html, external html. the html option is a GUI editor for an html email. the external option allows me to paste in code that i've created already. the first line in that mode is always a doctype. its the very first line in your code and usually looks something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Are you editing the code in your email program or using a WYSIWYG editor?I am using Front page to create the code.
Thanks.I am using Front page to create the code.That'd be your problem, the code is horrific.Thanks Silverbullet,
I added the doctype and ran it through W3 markup validation for 4.01 transitional, cleaned up all the bad stuff and it works fine now!
The Tree, I'm not sure if you're insulting me or front page for the horrific code?
I'm doing my best to learn how to code better and that's why I'm asking for assistance.
ThanksHi -
Trust me, the insult is for Front Page.
It's a really awful hand to hold for walking you through the learning process...
ElIt doesn't work because you put the CSS in the HEAD. When you send a HTML Email to webmail clients like Gmail, Hotmail, etc., than everything in the HEAD-tags and BODY tags are ignored or removed. Also the doctype you enter is ignored or removed.
So you have to use inline styles instead of embedded styles.
Have a look at Create compatible HTML Email (<!-- m --><a class="postlink" href="http://www.anandgraves.com/redirect/htmlemail.html">http://www.anandgraves.com/redirect/htmlemail.html</a><!-- m -->) .
I have also written a HTML Email Validator (<!-- m --><a class="postlink" href="http://www.anandgraves.com/html-email-validator/">http://www.anandgraves.com/html-email-validator/</a><!-- m -->) . Copy and paste your HTML into the validator and it will report the errors in your code. Each error has a link that referers to the article Create compatible HTML Email (<!-- m --><a class="postlink" href="http://www.anandgraves.com/redirect/htmlemail.html">http://www.anandgraves.com/redirect/htmlemail.html</a><!-- m -->) for more information on the error.