简体   繁体   中英

Styling HTML e-mail

When creating an HTML e-mail how do you specify the appearance, for example the font? Is there a better way than using inline CSS? I'm using cfmail to send e-mails.

You can style it in the <style> blocks in the head section, but the best/consistent way to style anything in HTML emails is by doing it inline unfortunately. If you're feeling lazy you can use http://premailer.dialect.ca/ to move everything inline for you.

The most important aspect of html mails is making sure the recipient can read the mail. For this reason it is important to stick to basic HTML and than means inline CSS only i'm afraid.

I use this tool - http://inlinestyler.torchboxapps.com/
Source files - https://github.com/davecranwell/inline-styler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM