This is the second application on the same server that I am having issues sending mail. I have had this issue before and you can read about it here http://www.danvega.org/blog/2011/6/11/Strange-email-issue
In my new app I used pretty much the same code and the emails are coming into gmail stripped of any body. The only way I can the see the contents is to view raw message. Any ideas on what the heck is going on here?
public void function sendNotification(contact){
var template = ‘contact/sendNotification’;
// create a new mail object
local.email = MailService.newMail().config(
from="dan@abc.com",
to="danvega@abc.com",
subject=“Toys For Shots Contact Form Submission”
);
/**
- Set tokens within the mail object. The tokens will be evaluated
- by the ColdBox Mail Service. Any matching @key@ within the view
- will be replaced with the token’s value
*/
local.email.setBodyTokens({
name = arguments.contact.getName(),
email = arguments.contact.getEmail(),
phone = arguments.contact.getPhone(),
comments = arguments.contact.getComments()
});
// Add HTML email
local.email.addMailPart(charset=‘ISO-8859-1’,type=‘text/html’,body=renderer.renderView(view=template));
// Send the email. MailResult is a boolean.
local.mailResult = mailService.send(local.Email);
}