asp.net mvc - Generate html in body with RazorEngine email template -


i'm using razorengine generate email template.

the issue i'm having cannot add line break in email body.

var model = new emailmodel         {             destination = "anon@gmail.com",             subject = "some subject",             body = "hello <br> break <br> <br> up"         };  var service = templatemanager.razorservice; var htmlbody = service.runcompile("emailtemplate.cshtml", model.gettype(), model); await emailservice.sendemail(model.destination, model.subject, htmlbody); 

i tried doing following in template:

@html.raw(model.body) 

but still won't decode html, ideas?

your <br> tag in body incorrect.

replace <br> <br />


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -