#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    67
    Rep Power
    5

    CFMAIL: SMTP Status Codes


    I have a FLASH program which uses CFMail to send an email via MS Exchange's SMTP. Is there a way to get the SMTP server response (or the interaction with the server) so that I know whether there is a problem or not?
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,270
    Rep Power
    968
    Not directly, because email messages are spooled and sent asynchronously. However, there are a number of tools that people have written to help (mainly by periodically inspecting the undelivered mail folder), such as CFMail Automatic Respooler. RIAForge has more.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    67
    Rep Power
    5
    Kiteless, thank you. Are we saying that ColdFusion sees responses from the SMTP server but just doesn't make them directly available?
  6. #4
  7. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,270
    Rep Power
    968
    Basically, yes, because emails aren't sent synchronously. CF can handle sending vast numbers of messages (tens of thousands) so there's no way this could provide an immediate result. When you call cfmail, you're adding a message to a queue that will be sent out at some future point by separate process threads.

    Couple that with the fact that most SMTP servers have their own queues, attempt to resend failed messages, etc., which also adds potential delays. Remember, CF isn't a mail server. CF just forwards the message to an SMTP server and *that* is what actually sends the message out to the recipient's mail server. So *eventually* a failure should be reported back to CF, but that could be seconds, minutes, or even hours later. These go into an undelivered folder, which is what "retry" tools like the ones I linked to earlier use.
    Last edited by kiteless; January 8th, 2013 at 11:04 PM.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Posts
    67
    Rep Power
    5

    CFMail SMTP Status codes - question answered/solved


    Kiteless, excellent! That confirms my thinking. I was concerned when today, I was testing the email process and 2 attempts didn't result in emails reaching the recipient (me) and the 3rd took forever. I couldn't see any errors in server or MSExchange logs (I'm remote, connected via VPN). I eventually shut everything down on my computer, re-booted and tried again. This time it worked. Then I remembered the "undelivered" folder and there the first 2 were!

    Many thanks!

IMN logo majestic logo threadwatch logo seochat tools logo