Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Html Emails How?
Chesso
post Nov 14 2007, 12:32 PM
Post #1


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



How on earth do you create HTML emails?

I have been searching Google for some time now and can find ABSOLUTELY no information what so ever on how to ACTUALLY create HTML content emails.

It just a bunch of programs and Microsoft applications, or testing facilities, I don't need any of this, there must be some coding system to it?

I tried emailing using basic direct HTML tags (like <b>), but it fails (it just shows <b>), so how can I do this?

I am not looking for anything really fancy, I just want to use some basic bolding and font changes and things to make it look a little more professional and thought out.

Can you use CSS also?

There has to be a way, hopefully someone here knows lol.
Go to the top of the page
 
+Quote Post
Chesso
post Nov 14 2007, 12:51 PM
Post #2


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



Oh and also here is what I use in PHP basically to send email:

CODE
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" );


$mailto is the email to send to obviously (if that has an effect).

$subject is self explanatory.

$messageproper is the actual content of the message.

The last bit I assume are the headers (I think I got this bit from somewhere else), so I am unfamiliar exactly with what to do with the headers.

I found some information on HTML emails, with changing the headers to make it work, but then it left out anything of like what I have, which makes me wonder if the mails would still even work properly?
Go to the top of the page
 
+Quote Post
pyost
post Nov 14 2007, 01:45 PM
Post #3


Nenad Bozidarevic
Group Icon

Group: [MODERATOR]
Posts: 993
Joined: 7-November 05
From: Belgrade, Serbia
Member No.: 9,500



It's all about the headers (or at least it should be), so take a look at this example at php.net: http://www.php.net/function.mail#id3111223

Basically, you would just need to add these two header lines two your e-mail:

CODE
$headers  = '(anti-spam-(anti-spam-mime-version:)) 1.0' . "rn";
$headers .= '(anti-spam-(anti-spam-content-type:)) text/html; charset=iso-8859-1' . "rn";


~edit~

The forum won't allow me to write this piece of code properly (due to anti-spam protection), so look for these two lines in the example.
Go to the top of the page
 
+Quote Post
Chesso
post Nov 15 2007, 01:09 AM
Post #4


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



That looks to work just fine.

It appears CSS does not work though, I have heard you can use Javascript and things, but I don't really need that.

Is there any particular reason why it ignores CSS?
Go to the top of the page
 
+Quote Post
Quatrux
post Nov 15 2007, 05:48 AM
Post #5


the Q
Group Icon

Group: [HOSTED]
Posts: 982
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059



It depends on the email client or webmail, some email clients doesn't allow images, html tags, javascript, css, it's all usually can be control by some Preferences of the Email Software you're using.. For example, Thunderbird can easily support CSS in HTML emails, I can't find an idea why it doesn't work, how are you using the CSS? in style tags or style="color: red"? Also, don't know how you're using them, it may need a right CSS header if you're linking to a CSS file on the web or things like that, as I remember it is: "(anti-spam-content-type:) text/css", if you're linking to it you could use PHP to send that header like this: <?php header("(anti-spam-content-type:) text/css");?>

Nevertheless, it could be your Email client or Webmail which doesn't support CSS or CSS is disabled.
Go to the top of the page
 
+Quote Post
Chesso
post Nov 15 2007, 06:29 AM
Post #6


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



Ummm I'm using Gmail, with default settings.

I was trying to use inline CSS, as in within the HTML tags themselves using style=

And that's about it.
Go to the top of the page
 
+Quote Post
pyost
post Nov 15 2007, 12:24 PM
Post #7


Nenad Bozidarevic
Group Icon

Group: [MODERATOR]
Posts: 993
Joined: 7-November 05
From: Belgrade, Serbia
Member No.: 9,500



Inline CSS should work properly - I am looking at an mail in GMail with them and there is no problem.
Go to the top of the page
 
+Quote Post
TavoxPeru
post Nov 17 2007, 04:49 AM
Post #8


Super Member
Group Icon

Group: [HOSTED]
Posts: 713
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



What pyost says about using inline css to format the content of your messages to send it as an html email is correct.

You have two options to attach the styles that you want to use:
  • Using style direcly in your HTML tags like <p style="color: #f00">text in red</p> or
  • Using style in the HEAD of the document like: <style type="text/css">p { color: #f00; } </style>
Also, it is recommended that your message includes both versions of your email, in plain text and in html. And of course, remember to use the correct headers.

Best regards,
Go to the top of the page
 
+Quote Post
Chesso
post Nov 17 2007, 06:06 AM
Post #9


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



I used inline CSS to create borders for a table (works under normal circumstances without fail).

Both versions of my email? What do you mean, like send both at the same time (that makes no sense lol), these emails are just for me personally, not for anyone else.

And for now they are only going into GMail, I am just trying to create a standard and (I know it's definitely for me) type of feedback email, so I know it's purpose and where all the information will be right away.

Much like I would a HTML/CSS etc page.
Go to the top of the page
 
+Quote Post
ethergeek
post Nov 17 2007, 06:54 AM
Post #10


Premium Member
Group Icon

Group: [HOSTED]
Posts: 393
Joined: 9-March 07
From: Tucson, AZ
Member No.: 20,794



HTML emails suck...I mean, they take longer to download, they just pretty up the information meant to be conveyed in the email. So yes, if you MUST send HTML email for some insane reason, please, for the love of god, send it as plain-text also.

Most people have no idea how annoying it is to try to read HTML formatted email with a text reader over a shell link via mutt :/
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Basic Tips and Tricks in HTML(15)
  2. Embedding XML into HTML(2)
  3. Rapid HTML code generation using simple PHP(8)
  4. HTML 101 - Web Design For Beginners(7)
  5. Force Object To Load Last(2)
  6. Web Browsing With Vim(2)
  7. Creating Tooltips(7)
  8. Free Shoutbox? HTML, Flash or PHP Code(24)
  9. Need Help On HTML Matrix(6)
  10. HTM vs HTML: Whats The Difference ?(22)
  11. HTML Tags(4)
  12. Tutorial: Dreamweaver, 3ds Max, Flash, Html, Css(8)
  13. 4 Html Based Website Tips(4)
  14. Html Basic Tutorial(8)
  15. Html Stats(3)
  1. About Html(15)
  2. Video Player(0)
  3. Html Table Issue.(18)
  4. Nvu(2)
  5. Html Table Rows Problem [solved](1)
  6. Sitepoint's Css And Html Reference Sites(2)
  7. W3 Schools(1)
  8. Desperate With Help On Php And Imap To Read Emails. Please!(1)
  9. Increase Your Knowledge Of Html Language(7)
  10. Javascript Tutorial For Beginner(0)
  11. Yaml - (x)html/css Framework(2)
  12. Not Receiving Emails Since April 25(1)
  13. Style P And H? Html Tags(1)


 



- Lo-Fi Version Time is now: 6th July 2008 - 10:52 PM