Class MailMessage: reference a CSS in a newsletter

M

Michel Couche

Hello,

I am starting the development of a newsletter
The use of the class MailMessage of System.Net.Mail is quite straightforward for usual contact forms but my question here is "How can I reference a CSS file in the header of my newsletter message ?"

Here is where I am ....

(1) I found a way to reference a web page in the body of the message (ref: http://www.systemwebmail.com/faq/3.2.aspx)

Dim mail As New MailMessage()
.....
Dim url As String = "http://www.MySite.com/MyPage.html"
mail.Body = HttpContent(url)
mail.BodyFormat = MailFormat.Html
mail.UrlContentBase = url
.....
Actually I would like to programmatically build the Body and therefore this solution lacks flexibility in my scenario


(2) I also looked at the Headers, UrlContentLocation and UrlContentBase properties as possible solutions to add a reference to a CSS file but found to practical answer to my question.

Thanks in advance for your support,

Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top