Skip to main content
November 29, 2011
Answered

Why is ColdFusion 9 moving email to Undelivr folder?

  • November 29, 2011
  • 2 replies
  • 976 views

Hi all,

I have a user signup page where I use a <cfmail> like this on the action page:

<cfmail to="#FORM.email#" from="#strEmailFrom#" type="html" subject="Your #strSiteName# details">

          <p>A forum user has been created with this email address on the #strSiteName# website. </p>

          <p>The login details are as follows:</p>

          <ul>

                    <li>Username: #FORM.username#</li>

                    <li>Password: #strThePass#</li>

          </ul>

          <p>You can use these dteails to log into the site, edit your profile and participate in discussions. </p>

</cfmail>

The page is running as it should but for some reason, ColdFusion is moving the email to /opt/coldfusion9/Mail/Undelivr and not sending it. The very strange thing is that it previously worked when I was testing it, but I'd forgotten to put the hashes around #strSiteName# in the subject, so it was sending out emails with the title "Your strSiteName details". I added in the hashes and now this is happening. It seems impossible that could be the cause, but I don't think I've changed anything else.

Thanks to anyone who can help.

T

This topic has been closed for replies.
Correct answer

Hi Owain, we turned on mail logging and noticed "Blank address" or similar in one of the logs. Turns out cfmail needs the from attribute to be an email address, or a name and then <name@email.com>, so:

<cfmail from="name@email.com">

or

<cfmail from="Person Name <name@email.com>">

or ColdFusion moves it to the Mail/Undelivr folder. This may be a new requirement in CF9 as a I believe I've used cfmail without a from email in the past before we upgraded to v9.

T

2 replies

BKBK
Community Expert
Community Expert
November 29, 2011

Some validation should help.

<cfif isValid("email",FORM.email) and isValid("email",strEmailFrom)>

<cfmail>

...

</cfmail>

<cfelse>

<!--- At least 1 e-mail is invalid. Do something, for example, inform user of log occurrence --->

</cfif>

Owainnorth
Inspiring
November 29, 2011

Try turning on mail logging in CF admin, that should tell you everything you need to know. Have you tried opening up the emails to see what's in them?

Correct answer
November 29, 2011

Hi Owain, we turned on mail logging and noticed "Blank address" or similar in one of the logs. Turns out cfmail needs the from attribute to be an email address, or a name and then <name@email.com>, so:

<cfmail from="name@email.com">

or

<cfmail from="Person Name <name@email.com>">

or ColdFusion moves it to the Mail/Undelivr folder. This may be a new requirement in CF9 as a I believe I've used cfmail without a from email in the past before we upgraded to v9.

T

Owainnorth
Inspiring
November 29, 2011

You are correct, came in with CF8 iirc. Logs ftw