tone
tone

Reputation: 1555

Using html page as mail body in asp.net

I have an email template in a file called template.html, how can i use it as mail body in asp.net?

Upvotes: 1

Views: 4033

Answers (2)

XUB Inc.
XUB Inc.

Reputation: 31

You can use this:

File.ReadAllText("template.html")

//This is to read template.html then you can pass this through
//formatemail() function if you have or
//message.body = File.ReadAllText("template.html");

Upvotes: 3

David
David

Reputation: 73594

There's a sample here with code.

Or you could use the MailDefinition class.

Upvotes: 3

Related Questions