A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearHow can I send HTML mails with included CSS with PHPMailer? - page 1
User InfoPosts
How can I send HTML mails with included CSS with PHPMailer?#1
I have problem with sending HTML mails with PHPMailer. I make a Smarty template and I got all the HTML code from it, but when I send mail, I got the mail without included CSS (it's only background-color, font or something like that). In PHPMailer I set that the mail is HTML.

Is there any way to send HTML mail with included CSS?

posted date: 2008-12-11 01:33:00


Re: How can I send HTML mails with included CSS with PHPMailer?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-11 01:33:01


Re: How can I send HTML mails with included CSS with PHPMailer?#3
HTML and CSS is fraught with pain and frustration. Nothing to do with PHP, it's apparent that most implementations *cough*outlook*cough* were and remain archaic.This is the only area where I would advise this (and someone else might have a better understanding/plan*), but you should look at cutting the CSS and writing mid-90's style html with <table>, <font> and <hr> tags (oh my)** please share :)*

posted date: 2008-12-11 01:39:00


Re: How can I send HTML mails with included CSS with PHPMailer?#4
How is your stylesheet referenced?For email you will either have to provide an absolute path to your stylesheet or include the styles in the head of the template

posted date: 2008-12-11 01:40:00


Re: How can I send HTML mails with included CSS with PHPMailer?#5
I assume you have your CSS in an external file, if so the easiest solution would be to simply move it into the html header inside the mail.However, css support in email clients is very wonky, so it might just be crappy rendering on their part.

posted date: 2008-12-11 01:41:00


Re: How can I send HTML mails with included CSS with PHPMailer?#6
I have CSS into the html header inside the mail . But thx for advice

posted date: 2008-12-11 01:44:00


Re: How can I send HTML mails with included CSS with PHPMailer?#7
well the CSS is really minimalistic and yes I have <table>, but only I really want is to change background color or some basic things.

posted date: 2008-12-11 01:46:00


Re: How can I send HTML mails with included CSS with PHPMailer?#8
Check out the answer to this StackOverflow question for a good list of links on best practices for HTML emails: Best Practices & Considerations when writing HTML Emails

posted date: 2008-12-11 01:47:00


Re: How can I send HTML mails with included CSS with PHPMailer?#9
CSS support in e-mail is very limited, at least.The biggest issue is that different clients support different sets of CSS-properties.You provide very little context for us to work with.How is your e-mail showing? Is CSS not parsed at all? Is your CSS showing on-screen as text?How does your CSS look?How does your e-mail template look?For more information on CSS support in e-mail, please refer to this excellent overview.

posted date: 2008-12-11 01:48:00


Re: How can I send HTML mails with included CSS with PHPMailer?#10
Just add it inline I suggest

posted date: 2008-12-11 01:51:00


Re: How can I send HTML mails with included CSS with PHPMailer?#11
1. CSS is not showing at all, only the HTML is rendered 2. my css looks: pastebin.com/m5787d770 3. and complete template looks: pastebin.com/m346a5475 Thank you for the link, I appreciate it.

posted date: 2008-12-11 02:01:00


Re: How can I send HTML mails with included CSS with PHPMailer?#12
Some Email Clients will strip out the <head> section so put your <style></style> tags within the <body>.

posted date: 2008-12-11 02:13:00


select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.