...

View Full Version : How do I add HTML code to E-mail?



davidc2
05-08-2008, 02:48 PM
I can't get it to work on webmail.. like yahoo, hotmail, or gmail... whenever I try something like

<html>
<body>
<h1><font color="red">HI</font></h1>
</body>
</html>

All I get is plain text...

abduraooft
05-08-2008, 03:01 PM
You need to change the headers as text/html,
see http://in.php.net/manual/en/function.mail.php Example #4

davidc2
05-08-2008, 03:09 PM
You need to change the headers as text/html,
see http://in.php.net/manual/en/function.mail.php Example #4

Yeah that would work if I was using the mail function in PHP, but as I mentioned, I'd like to do it on a web mail provider.

abduraooft
05-08-2008, 03:21 PM
Yeah that would work if I was using the mail function in PHP, but as I mentioned, I'd like to do it on a web mail provider.
Most of them provide their own rich text editors, where you could apply the required styles and formatting.
Otherwise they may encode any html tags to its equivalent html entity.

davidc2
05-08-2008, 03:23 PM
Most of them provide their own rich text editors, where you could apply the required styles and formatting.
Otherwise they may encode any html tags to its equivalent html entity.

Ok, so how would I do it on hotmail?

jcdevelopment
05-08-2008, 03:31 PM
I was googling the commercial mail editors and composers like yahoo and gmail..etc.. and most all of them have an option to switch it on. Most have a button or option that say, "recognize html tags". Although i cant find exactly where they are at!

abduraooft
05-08-2008, 03:41 PM
Ok, so how would I do it on hotmail?
I don't have a hotmail account, but in Gmail/yahoo there is link to switch from plain/rich or reverse, see the screenshots of gmail and yahoo editors

jcdevelopment
05-08-2008, 03:44 PM
see i tried changing the e-mail to plain text, then sent it to my other account and it came back as not html.. and i have html turned on, on both of the accounts.. i must be doing something wrong too!

davidc2
05-08-2008, 03:53 PM
I don't have a hotmail account, but in Gmail/yahoo there is link to switch from plain/rich or reverse, see the screenshots of gmail and yahoo editors

That will give you access to whatever options they give you, like bold, center, etc... But I want to actually write the HTML code...

If you do rich, you still wouldn't be able to have this on your message:
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG src="http://www.google.com/intl/en_ALL/images/logo.gif" >
</BODY>

davidc2
05-08-2008, 03:55 PM
see i tried changing the e-mail to plain text, then sent it to my other account and it came back as not html.. and i have html turned on, on both of the accounts.. i must be doing something wrong too!

It's not supposed to be plain text.

Plain text will send "Content-Type: text/plain" as your meta tag, and you actually want it to say "text/html".

abduraooft
05-08-2008, 04:08 PM
That will give you access to whatever options they give you, like bold, center, etc... But I want to actually write the HTML code...

If you do rich, you still wouldn't be able to have this on your message:
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG src="http://www.google.com/intl/en_ALL/images/logo.gif" >
</BODY>
When we email the above snippet in GMail, it'll convert every < > symbols to it's equivalent.

So in FF, just select the mail from you inbox and you may get something like

&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;IMG src="<a href="http://www.google.com/intl/en_ALL/images/logo.gif" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.google.com/intl/en<wbr>_ALL/images/logo.gif</a>" &gt;<br>&lt;/BODY&gt;

Or when you highlight and use view source option, you may see

<div class="mb"><div id="mb_0">&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;IMG src="<a href="http://www.google.com/intl/en_ALL/images/logo.gif" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.google.com/intl/en<wbr>_ALL/images/logo.gif</a>" &gt;<br>&lt;/BODY&gt;
</div><br style="font-size: 8px;" clear="all"></div>

Thus in order to send html emails in using such mail system, you may have to follow their own rich text editor

davidc2
05-08-2008, 04:35 PM
When we email the above snippet in GMail, it'll convert every < > symbols to it's equivalent.

So in FF, just select the mail from you inbox and you may get something like

Or when you highlight and use view source option, you may see

<div class="mb"><div id="mb_0">&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;IMG src="<a href="http://www.google.com/intl/en_ALL/images/logo.gif" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.google.com/intl/en<wbr>_ALL/images/logo.gif</a>" &gt;<br>&lt;/BODY&gt;
</div><br style="font-size: 8px;" clear="all"></div>

Thus in order to send html emails in using such mail system, you may have to follow their own rich text editor

So what would I need to type on the message to get it to display an image as HTML?

What would the actual message look like?

davidc2
05-09-2008, 02:10 PM
This kinda helps...
http://tips-reviews-how-to.blogspot.com/2007/11/embedding-images-in-gmail.html

But it's not quite it... Any one else with suggestions?

davidc2
05-13-2008, 06:06 PM
this is a bump

abduraooft
05-14-2008, 08:00 AM
Have a try by highlighting an image from a website's page and then copy+paste in to the rich text editors of these emails

davidc2
05-14-2008, 02:29 PM
Have a try by highlighting an image from a website's page and then copy+paste in to the rich text editors of these emails

That works, thanks, and I can link the image and stuff.. But that's not really writing the code, I'd like to see what the code would look like ON the editor.

That does help me work around this though, appreciate your input.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum