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.
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#"
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.
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?
We have better than sendgrid delivery rates for our clients industries, we use our mailserver to do what it does best, then we use CF and the mailserver api to read/write/move mail between folders,etc.
There is so much to configure with mailservers these days to get great delivery that it’s a whole blog article… but if you don’t have DKIM and spf and signup to get reporting from microsoft and others about deliverability on your ips then you’ll suffer. (starting point)