Link to home
Start Free TrialLog in
Avatar of sirnutty1
sirnutty1

asked on

PHPMailer CSS

Hi Experts

I am looking for the best solution to use in order to include css styling in html emails that I am sending using PHPMailer.

There seem to be many options and many different ways that clients could potentially handle them.

Most of the suggestions point to using inline styles but others embed, link etc.

What would you suggest as being the best option to go for?
Avatar of aldanch
aldanch
Flag of United States of America image

If it is simple content you are sending a quick inline style should do the trick. I usually use a styled <div style=""></div> block when sending short emails.
Avatar of sirnutty1
sirnutty1

ASKER

Many thanks for your response aldanch.

How about if the content is more complicated. There will of course be some simpler variations but for our weekly newsletter, it would nice to use something will a little design.
ASKER CERTIFIED SOLUTION
Avatar of aldanch
aldanch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks aldanch

Just did the test as suggested and with a little tweaking, I think that it will work fine. Can you just clarify one extra point for me?

Does it make any difference if the html doesn't have HTML, HEAD or BODY tags in it?

Sincere thanks again for your help.
Honestly, I don't know. I have sent HTML formatted email using (like I said previously) just plain inline styled DIVs and it appeared to work just fine. I am guessing you could leave out the <html> and <head> tags unless you have CSS in your head.

I am glad I could help! Good luck :)