smsohan/MvcMailer — Issue #41: No Body Rendered in Email
Author: steve99
Created: 2012-02-25 13:11:22+00:00
State: open

Hi,

I have got this working correctly in one project where I keep everything together. In the second I created a separate project which I scaffolded the mailers in and created a class which is called from my main controller. It does not raise any errors using	PopulateBody(mailMessage, viewName: "CreateNbus"); and it generates an email however the body is empty (other dynamic data is fine). I am writing the email file to disk.

I tried dropping out the master line in the class per another post but this didn't work. I also tried PopulateHtmlBody(mailMessage, "CreateNbus", "_Layout"); but this resulted in an error message about not finding the view. I wondered whether this is the underlying issue?? I note in another post it talked about name conflicts so I renamed the view and references to it to something more obscure than 'create'.

The only other thing I am doing which I didn't do on the standalone was to pass in data to the mailer so I could use dynamic data. This is causing problems with debugging as it raises an exception due to another process being already connected to it. Is there anything to write out to a log to assist?

Any ideas would be appreciated. If anymore details are needed then please shout.

Steve.