Cfmail sender with proper name

Can someone set me on the right path?

I have migrated an application from CF9 to Lucee. It runs fine so far with a few minor adjustments. Only when sending mail I can’t get any further:

With CF9 the email addresses looked like this: john.doe@example.com (John Doe)

In Lucee this does not work and the mails end up in undeliverable. Error message: invalid domain name

How do I do this in Lucee so that it works? I am now temporarily using only the email address. But I would like to show the whole name to the recipient. The documentation is still not complete in this matter.

Thanks,
Allan

I just happend to do this the other day. The format is:

"Mark Drew" <mark@example.com>

This includes the quote marks and angle brackets.

HTH

MD

2 Likes

This is not really a lucee issue, its a RFC / Mail transport issue.

You should not directly send email from any lucee box to the world, unless you are provisioning that box with a proper DNS MX record and conditionally want that box to receive email as per the RFC compliance, red path and other anti-spam service measures, just do not do it.

you can use lucee to send email via nearly any third party service, but what I have found is its easier to use a relay server. You can even set up your lucee instance to run postfix, sendmail, hmail, mercury mail, mail enable, to name a few.

create your account on the relay server. Your relay server can be your internal properly setup MX , SPF, DKIM mail server or forward to what that does.

Because this is what is happening with your mail
Lucee box spins up and fires off email
lucee pulls the localhost name from the OS
The mail server on the other end considers the email as a bogus non compliant traffic and does what ever policy they have set for bad actors and spam.

as for the tag, this works for us.
Note, As above I use a relay server hosted locally then pushes this out to our mail server

<cfset mailFrom="DO NOT REPLY  <DONOTREPLY@mydomain> " >
<CFMAIL
To="#mailTo#"
From="#mailFrom#"
1 Like

Very good advice from @Terry_Whitney. This is how you’ve the best control of e-mail deliverabilty.

1 Like

advice terry gave is for linux users, most windows local mail servers do not have this configuration issue, not having an email server on app server is good advice.

not that I ever put a mail server directly on a lucee machine, i have central email servers (smartermail) that can send up to 40 million emails a day off a dual core vm with 4gb ram and 20 ips that are all toasty warm (on azure), and also a couple of ses ones for backups (azure ones are almost free to run other than ip cost)

Azure without proper domain setup just sends emails off with the VPS IP address, which most spam filters look as bulk mail and perform the appropriate action.

Without any kind of third party mail server, I would love to hear how your delivery rates are and how you handle that kind of volumes delivery, bounce and tarpits in ColdFusion.

Thank you very much @markdrew ! This is exactly what I was looking for. Then there is probably one more point to work through when porting from CF to Lucee. :upside_down_face:

I am currently having some delivery issues to a local server in the same hosting facility, which I am working to rectify. That said, Terry’s post mentioning DKIM caught my eye. If I am connecting to an instance of SmarterMail on another box for my delivery processing, would I set the DKIM there, or on the Lucee server itself. Seems like it should be on the SM server, correct?

Hi Michael,

You are correct, DKIM is done on the sending mail server. In order for DKIM to work, the sending box must have proper MX records.

What ever internet facing box that is sending the email on behalf of the ColdFusion box, is the one where you would configure DKIM.

Right. Got it done last week and works like a charm. Thanks.

2 Likes