mariocesar Posted September 21, 2007 Share Posted September 21, 2007 Hello, how can I change the color of text on a mail content, if I want to make the color of Company, Name, Address, City (green) here is the code $mailContent="--------Contact--------\n\n" ."Company: ".$company."\n" ."Name: ".$firstname."".$lastname."\n" ."Address: ".$address."\n" ."City: ".$city."\n" ."State: ".$state."\n"; Thanks. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 if its an email I'd assume you are sending it as text which means that colors are not an option in texted based emails ,however if you are using a html based mail just use a font property Quote Link to comment Share on other sites More sharing options...
hvle Posted September 21, 2007 Share Posted September 21, 2007 first off, the email have to be send in html format. something like this will change the color: <font color="green">City</font> secondly, you posted in a wrong forum Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 first off, the email have to be send in html format. something like this will change the color: <font color="green">City</font> secondly, you posted in a wrong forum Wrong emails are not html at all. Its an option, and a poor one because only about 25% of email clients have full html support, the rest don't accept html. Emails are text first with the option to be html. Quote Link to comment Share on other sites More sharing options...
hvle Posted September 21, 2007 Share Posted September 21, 2007 only about 25% of email clients have full html support, the rest don't accept html. Emails are text first with the option to be html. 25%? You must be talking about the '90 where people still using DOS and Win95. By experience, I'd say 99% of people have html-support email clients. Quote Link to comment Share on other sites More sharing options...
freakstyle Posted September 21, 2007 Share Posted September 21, 2007 _multi part emails_ The acceptance ratio between html text isn't really that important, what is important is making sure you send BOTH versions, and send them both correctly. Recipients always have the option to receive text emails vs html. usually to try and avoid harmful content. Between us dev headz, there is very, very little support by any of the major players to correctly support html, to boot those on Vista / Outlook will be even worse off with the new outlook using word to render your messages. But that is no reason to not send html out, those who accept it, generally do so for a reason. With that aside, let me touch on question... yes you can send your email with a green font, should you use a font tag? i would say no, you should use inline styles when dealing with html email layouts. font tags are so 1999 another tip, do not use css to layout html in an email, it will never work on the majority of client apps. so what you should do is power up your favorite php editor and create either some functions or a class, that will help you send out emails. one approach would be to create your html email however you want it ( feel free to leave a flag for any place holder variables you need to pass through, i always go #EmailAddress#). then take that exact text in your email, and dump it into a new text file. then in your process page send the path locations to some sort of function/class that will deal with sending these out. This will make it easy to use again and again and again and again. these should get you started: http://us2.php.net/mail http://www.zend.com/zend/spotlight/sendmimeemailpart1.php best of luck to you Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 Go ahead send your html emails out and watch them never be accepted/recieved/look right. Text email = 99.99% acceptance rate HTML is way less. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 21, 2007 Share Posted September 21, 2007 lol where are you getting these stats cooldude? As hvle said, we're not in the 90's. Most people don't use pine to check their email anymore. And as long as you send BOTH does it fing matter? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 sending both is worse than sending html only. Reason its considered spam. You ask clients what they prefer in their email, if you send html your odds of having a consitent phrasing, and acceptance rate over 75% are gone, an email is a message and doesn't need fancy formatting and so forth, you will save you self a lot of headaches doing text only emails unless you see an absolute need for html (As in this case with a need for coloring). Sending email with php is hard enough already, why add that burden to it. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 21, 2007 Share Posted September 21, 2007 Sending email with PHP is hard? What? And how is it spam? Anyone who asks what to send obviously hasn't read the sort of things freakstyle posted. That's what multipart alternative is for. Geez. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.