• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Log email text

New Here ,
Jan 07, 2009 Jan 07, 2009

Copy link to clipboard

Copied

Hello.

Is it possible to capture the text of the email in mailsent.log?

Thank you,
TOPICS
Advanced techniques

Views

441

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2009 Jan 08, 2009

Copy link to clipboard

Copied

Torgom wrote:
> Hello.
>
> Is it possible to capture the text of the email in mailsent.log?

I don't think there's a way to do that from ColdFusion. The means to do
that will depends on your environment (OS, mail server, etc).

--
Mack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 08, 2009 Jan 08, 2009

Copy link to clipboard

Copied

Mack,

Do you know how to do that?

Thanks for the reply

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 08, 2009 Jan 08, 2009

Copy link to clipboard

Copied

There is no way to include the full body of the email message in the mailsent.log file; that only logs the datetime, subject, to/from, plus a status message and some other cf-related info.

So, what Mack was saying that is if CF won't do it natively you need to 'intercept' and copy the message at some other stage of the game. Two ways occur to me

1. You can add code to your CF app that sends a duplicate message to another email address of your choice (i.e. logger@somedomain.xyz) whenever someone uses the app to send a message. Or you could alternatively save the information contained in the message to a database if you don't need it in email format.

2. CF doesn't actually deliver the message, it hands the message off to some sort of mailer-daemon. On Windows that would typically be IIS, and on linux something like Postfix. The mailer-daemon is the program actually responsible for contacting the recipient's mailserver and delivering the message.

If we're talking about IIS SMTP, then you don't have the abliity to do what you want. It can send a non-delivery report and save failed messages but it can't send copies of successful deliveries.

At HostMySite we use Smartermail as our shared email solution. Since SmarterMail is a more robust email platform (compared to IIS SMTP, which just delivers mail) there is serverside f unctionality in it that will allow a serverwide rule to be put into place that saves a copy of all outbound messages in archived .zip files.

So, it boils down to what you're using to send, and what sort of capabilities it has...and if you're on a shared host, whether or not that sort of thing would be allowed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 09, 2009 Jan 09, 2009

Copy link to clipboard

Copied

Torgom wrote:
> Mack,
>
> Do you know how to do that?

Like I said tersely in my previous message it depends on your specific
environment and restrictions (as Fetch pointed out). So the solution
will be different depending on whether you're on shared hosting or
dedicated hosting, Linux with qmail, Linux with postfix, Windows, etc.

--
Mack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 12, 2009 Jan 12, 2009

Copy link to clipboard

Copied

LATEST
Sorry Mack, I don't do the whole brevity thing. 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation