|
|
|
|
![]() ![]() |
Nov 14 2007, 12:32 PM
Post
#1
|
|
|
Teh Coder 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. |
|
|
|
Nov 14 2007, 12:51 PM
Post
#2
|
|
|
Teh Coder 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? |
|
|
|
Nov 14 2007, 01:45 PM
Post
#3
|
|
|
Nenad Bozidarevic 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. |
|
|
|
Nov 15 2007, 01:09 AM
Post
#4
|
|
|
Teh Coder 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? |
|
|
|
Nov 15 2007, 05:48 AM
Post
#5
|
|
|
the Q 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. |
|
|
|
Nov 15 2007, 06:29 AM
Post
#6
|
|
|
Teh Coder 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. |
|
|
|
Nov 15 2007, 12:24 PM
Post
#7
|
|
|
Nenad Bozidarevic 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.
|
|
|
|
Nov 17 2007, 04:49 AM
Post
#8
|
|
|
Super Member 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:
Best regards, |
|
|
|
Nov 17 2007, 06:06 AM
Post
#9
|
|
|
Teh Coder 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. |
|
|
|
Nov 17 2007, 06:54 AM
Post
#10
|
|
|
Premium Member 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 :/ |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th July 2008 - 10:52 PM |