Mail Service Issue

Hi Dan,

We use PostMark here all the time (It was me that wrote all the protocol stuff in CB, including the postmark protocol itself.) - the service is excellent, changed my perspective on email from applications - SMTP is lacking in so many areas.

And yes, that’s pretty much how you config the protocol - here is an example from one of my apps:

mailSettings = {
protocol = {
class = “coldbox.system.core.mail.protocols.postmarkProtocol”,
properties = {
ApiKey = “KEY_GOES_HERE”
}
}
};

To start with using PostMark just gives you more control and visibility over your email, moving forward you can do all kinds of work with the bounce API and the new inbound parser API too for really exciting stuff.

There are other options, such as Amazon SES and SendGrid - but I’ve always found the personality and customer service from PostMark to be second to none - give it a whirl.

I’m here if you need any help.

Robert

I am going to look into it but I also want to find out why this isn’t working. I read some things online about noreply addresses. I am not sure this is the issue because its working other places but i am going to change out outgoing email to notifications@ and see if that does anything.

Hi Dan,

Do you mean you’re sending the emails from a noreply address?

Thanks.

Robert

Yes no-reply@domain.com

Also, make sure you add the port in the mail settings as it defaults to 25

mailsettings = { port = 465}

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Cool,

I don’t obviously know the business requirements you’re dealing with - but from a UX standpoint using no-reply is considered a bit of a bad habit.

The idea is that emails, even not intended are always about conversation, and what you’ll find is that even if users shouldn’t be replying to an address or email, they will, perhaps not even about the current conversation.

For instance - say I send a customer a notice to say thanks for their order. I could send it from a no-reply as I don’t need any response from them. However, what if they suddenly want to cancel? or 3 months down the line they have a question, search through their emails to find you, write a reply and then get a bounce as it’s a noreply address… you’re casting away important conversations, and pissing off the user at the same time.

Good UX should mean you always leave that channel for communication open, even if a large amount of the messages are silly white noise of customers pining back “Woohoo” and “Thank You’” because they don’t understand the email is automated.

Just my ideas.

Rob

Luis - I set that up in my config and I still have the same issue.

Robert - Good points!

Dump the payload to see what is being sent, that is the attribute collection for the cfmail tag.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

If I dump out payload its an object of type coldbox.system.core.mail.Mail

Hi Dan,

That’s the object you would expect, it should contain properties for mail.

Dump out Payload.getMemento() to get a struct of all the properties.

Robert

there is no getMomento method… there is a getMailParams

What exactly am I trying to see here?

I just read this thread. I had the same issue when using the coldbox email service vs the built in cfmail tag. The exact same problem that dan is reporting including the same exception. I ended up switching to Postmark because of this :slight_smile: But I’d love to solve it.

I am not using a no-reply email address, so I don’t think that’s the issue.

-Ben

Hi Dan,

What version of CB is this? I have the getMemento in my build.

The basic idea here I think Luis is trying to confirm all the settings actually in the payload before the send it made, just so we can be sure that the settings you’re defining in your config are being set and not overwritten etc.

Robert

@ben - that didn’t fix it, same issue with different email address

@Robert - that method is in the MailService… the payload is a Mail object / again even if i dump out all of the params, what do i need to be looking for?

what version are you using Dan?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

ColdBox 3.5.0 BETA NEAR-JAMES 4:8

the mail payload should have a get memento() on it. Dump it and see the values. That is what get’s passed to cfmail

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Robert,

I disagree with you here, it is very common practice to use a donotreply or noreply type of email address for communications, these are emails that send out communications that are not monitored post boxes.

So very common these days its not funny.

Although I agree with the fact that the user still needs to communicate somehow, there shouold at least be a link or directions on how to get in contact with the company.

found the problem! the memento does not have the following attributes needed to send mail through gmail smtp

usessl=“true” usetls=“true”

I took everything from the payload and created a simple cfmail tag and it didnt work, added the 2 attributes and it worked fine. I have these setup in my config but they aren’t getting passed for whatever reason.

mailSettings = {
server = “smtp.gmail.com”,
username = “notifications@***888",
password = "
”,
port = 465,
useSSL = true,
useTLS = true
};

So if I dump out the mail settings bean in the newMail() method the useSSL & useTLS attributes are there. However when I dump the mail object memento out I do not see them there. I suspect If I manually set them this is going to work but somewhere these settings are getting lost.

var mail = mailservice.newMail(to=user.getEmail(),
from=variables.outgoingemail,
subject=subject,
bodyTokens=bodyTokens);

// generate content for email from template
mail.setBody( renderer.renderView(view=“email_templates/user_register”) );
mail.setType(“HTML”);

writeDump(mail.getMemento());
abort;