andrewdavey / postal

Email sending for asp.net mvc using the view engine system to render emails.
http://aboutcode.net/postal
MIT License
536 stars 169 forks source link

Blank email body when trying to use plain text and HTML #151

Open bradykelly opened 8 years ago

bradykelly commented 8 years ago

I first just tried your main example, with no specification of plain or HTML. That rendered my hyperlink in plain text. Then, I tried following your example for both, which produced a correctly addressed mail, but with no body.

I have one Register.html with From, To, etc. then I have Register.Text.cshtml with the below header, and no HTML.

Content-Type: text/plain; charset=utf-8

Then I have Register.Html.cshtml, with below header, and and HTML body with a hyperlink:

Content-Type: text/html; charset=utf-8

Now all I get is a blank body when I send myself a mail.

I actually only want an HTML mail, but even just removing the plain text template still gives me a blank body.

codymaust commented 8 years ago

I'm seeing the same problem, using the latest package from NuGet.

adi-p commented 7 years ago

I had this issue, fixed it by having a blank line between the line with the content type and the rest of the template.

darronclarison412 commented 12 months ago

It seems like you're facing challenges with rendering the HTML body in your email. Ensure your HTML template is structured correctly with proper HTML tags and styling. Also, check for any formatting or syntax errors that might be causing the blank body. Testing by sending a basic HTML email Here first can help isolate the issue. Double-check the content-type header and ensure it's set to 'text/html'.