Archived Forum Post

Index of archived forum posts

Question:

How to add CSS File to an Email

Feb 22 '17 at 10:53

I am building a component that we will use for creating newsletters and mailing them. For the newsletter template I have html and I have a css-file. What is the recommended way of adding the css to the email? I succeed in adding the html to the mail, but the css, since it’s in a different mail, I don’t know how to handle.


Answer

An external CSS file can be added to an email as a "related item", in the same way as an image file is added. The "href" attribute of the "link" tag in the HTML would use the CID of the CSS related item, or it would use the Content-Location of the related item. I'll create an example..

A simpler solution would be to use inline CSS within the HTML..


Answer

Android: Send HTML Email with External CSS as Related Item

Classic ASP: Send HTML Email with External CSS as Related Item

C: Send HTML Email with External CSS as Related Item

Chilkat2-Python: Send HTML Email with External CSS as Related Item

C++: Send HTML Email with External CSS as Related Item

C#: Send HTML Email with External CSS as Related Item

C# UWP/WinRT: Send HTML Email with External CSS as Related Item

DataFlex: Send HTML Email with External CSS as Related Item

Delphi ActiveX: Send HTML Email with External CSS as Related Item

Delphi DLL: Send HTML Email with External CSS as Related Item

.NET Core C#: Send HTML Email with External CSS as Related Item

Excel: Send HTML Email with External CSS as Related Item

Visual FoxPro: Send HTML Email with External CSS as Related Item

Java: Send HTML Email with External CSS as Related Item

Lianja: Send HTML Email with External CSS as Related Item

MFC: Send HTML Email with External CSS as Related Item

Mono C#: Send HTML Email with External CSS as Related Item

Node.js: Send HTML Email with External CSS as Related Item

Objective-C: Send HTML Email with External CSS as Related Item

Perl: Send HTML Email with External CSS as Related Item

PHP ActiveX: Send HTML Email with External CSS as Related Item

PHP Extension: Send HTML Email with External CSS as Related Item

PowerBuilder: Send HTML Email with External CSS as Related Item

PowerShell: Send HTML Email with External CSS as Related Item

PureBasic: Send HTML Email with External CSS as Related Item

Python: Send HTML Email with External CSS as Related Item

Ruby: Send HTML Email with External CSS as Related Item

SQL Server: Send HTML Email with External CSS as Related Item

Swift: Send HTML Email with External CSS as Related Item

Tcl: Send HTML Email with External CSS as Related Item

Unicode C: Send HTML Email with External CSS as Related Item

Unicode C++: Send HTML Email with External CSS as Related Item

Visual Basic 6.0: Send HTML Email with External CSS as Related Item

VB.NET: Send HTML Email with External CSS as Related Item

VB.NET UWP/WinRT: Send HTML Email with External CSS as Related Item

VBScript: Send HTML Email with External CSS as Related Item

Xojo Plugin: Send HTML Email with External CSS as Related Item