Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-08-2008, 02:48 PM   PM User | #1
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
How do I add HTML code to E-mail?

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...
davidc2 is offline   Reply With Quote
Old 05-08-2008, 03:01 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
You need to change the headers as text/html,
see http://in.php.net/manual/en/function.mail.php Example #4
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-08-2008, 03:09 PM   PM User | #3
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
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.

Last edited by davidc2; 05-08-2008 at 03:15 PM..
davidc2 is offline   Reply With Quote
Old 05-08-2008, 03:21 PM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by davidc2 View Post
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.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-08-2008, 03:23 PM   PM User | #5
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
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?
davidc2 is offline   Reply With Quote
Old 05-08-2008, 03:31 PM   PM User | #6
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
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!
jcdevelopment is offline   Reply With Quote
Old 05-08-2008, 03:41 PM   PM User | #7
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by davidc2 View Post
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
Attached Thumbnails
Click image for larger version

Name:	gmail.JPG
Views:	75
Size:	8.3 KB
ID:	6320   Click image for larger version

Name:	yahoo`.JPG
Views:	67
Size:	8.3 KB
ID:	6321  
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-08-2008, 03:44 PM   PM User | #8
jcdevelopment
Senior Coder

 
jcdevelopment's Avatar
 
Join Date: Oct 2007
Location: Cowboy Nation
Posts: 2,171
Thanks: 173
Thanked 257 Times in 257 Posts
jcdevelopment will become famous soon enoughjcdevelopment will become famous soon enough
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!
jcdevelopment is offline   Reply With Quote
Old 05-08-2008, 03:53 PM   PM User | #9
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
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 is offline   Reply With Quote
Old 05-08-2008, 03:55 PM   PM User | #10
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
Quote:
Originally Posted by jcdevelopment View Post
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".
davidc2 is offline   Reply With Quote
Old 05-08-2008, 04:08 PM   PM User | #11
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by davidc2 View Post
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
Quote:
&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
Code:
<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
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-08-2008, 04:35 PM   PM User | #12
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
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
Code:
<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?

Last edited by davidc2; 05-09-2008 at 02:03 PM..
davidc2 is offline   Reply With Quote
Old 05-09-2008, 02:10 PM   PM User | #13
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
This kinda helps...
http://tips-reviews-how-to.blogspot....-in-gmail.html

But it's not quite it... Any one else with suggestions?
davidc2 is offline   Reply With Quote
Old 05-13-2008, 06:06 PM   PM User | #14
davidc2
Regular Coder

 
Join Date: Jul 2006
Posts: 124
Thanks: 1
Thanked 0 Times in 0 Posts
davidc2 is an unknown quantity at this point
this is a bump
davidc2 is offline   Reply With Quote
Old 05-14-2008, 08:00 AM   PM User | #15
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
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
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:06 AM.


Advertisement
Log in to turn off these ads.