Search code examples
coldfusioncfmail

CFMail with catchall email addresses


I can't believe I've never noticed this before, but it seems that CFMail won't send to an email address that isn't explicitly set up on the destination mailserver.

This means that if I'm using 'info@somedomainorother.com' and have that set up to catch all email on the domain, CFMail won't send to 'test@somedomainorother.com'.

This causes a massive amount of problems for me, as I'm using CFMail to send out order confirmations, member activations and all manner of other bits and pieces.

Whatever your views on using catchall addresses, it can't be denied that people do use them So, in any case that a user enters a made-up address into one of my sites, they won't receive their email.

There must, simply MUST be a way around this - can anyone help?

For refernece, the message that appears in the logs when sending to a catchall address is 'Invalid Addresses'.

EDIT: Here's the CFMail syntax I'm using -

<cfmail to="#Arguments.sEmailAddress#" from="#Application.sAppEmailAddress#" subject="Stock reminder confirmation: #Local.qGetProductDetails.sProductName# - #Application.sCompanyName#" type="HTML" server="#Application.sAppEmailServer#" username="#Application.sAppEmailAddress#" password="#Application.sAppEmailPassword#">

Translates into:

<cfmail to="thisisatest@somedomainorother.com" from="application@mydomainname.com" subject="Stock reminder confirmation: Some product - My Company" type="HTML" server="mail.mydomainname.com" username="application@mydomainname.com" password="XXXXXX">

All works fine for info@somedomainorother.com but not for randombunchofcharacters@somedomainorother.com.

Important to note of course, that the catch-all is working correctly in all other respects, test emails from mail clients work perfectly.


Solution

  • Urgh!

    Turns out it was an issue with the server. For some reason, catchall email accounts serverwide had stopped working properly. After an email to my hosting provider, it's all working fine with no code changes.

    They're somewhat cagey as to what caused the issue, and I was still able to use an email client to send mail out to the addresses...

    Thanks for the help in any case. ;)