Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 598295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:22:24+00:00 2026-05-13T16:22:24+00:00

To solve an issue with sending e-mail through a smtp-server where e-mails are not

  • 0

To solve an issue with sending e-mail through a smtp-server where e-mails are not getting sent, I was adviced to enable logging using System.Diagnosis.TextWriterTraceListener to trace the communication with the smtp-server to track any errors. I added the following to my web.config under the node:

<system.diagnostics>
      <trace autoflush="true" />
      <sources>
        <source name="System.Net" >
          <listeners>
            <add name="MyTraceFile"/>
          </listeners>
        </source>

        <source name="System.Net.Sockets">
          <listeners>
            <add name="MyTraceFile"/>
          </listeners>
        </source>
      </sources>

      <sharedListeners>
        <add
          name="MyTraceFile"
          type="System.Diagnostics.TextWriterTraceListener"
          initializeData="System.Net.trace.log"                />
      </sharedListeners>

      <switches>
        <add name="System.Net" value="Verbose" />
        <add name="System.Net.Sockets" value="Verbose" />
      </switches>
    </system.diagnostics>

I tried it out on my development machine and it worked just fine! I could easely read out the complete communication with the smtp-server. However, at the production environment (running on IIS 6 in Windows 2003 Server), it does not work at all. No log is getting written to the filesystem. My first thought was that perhaps the ASP.NET worker process account (NETWORK SERVICE) did not have sufficient rights to write to the filesystem at the specified location. I fixed that, but still get no log. Second, I thought that perhaps the folder was set to “read only” and fixed that as well. But still I get no log written.

Do anyone have an idea what the problem might be? Or perhaps some advice on how I could fix this? Thanx in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:22:24+00:00Added an answer on May 13, 2026 at 4:22 pm

    First of all, I’d check if the trace actually works without writing anything to the file system. That is, I’d just use the regular windows trace. In order to view the trace output, I’d use Windows Sysinternals’ DebugView. Of course, perhaps you should change your config file, I’m not that familiar with the syntax.

    Now, if everything works fine for both environments (development and production), so that you can view the trace messages in the viewer, then the problem is more focused on the file system and log saving.

    Where do you think your log file is saved to? Maybe it’s a different location when it comes to production environment. I think that on Windows Server 2003 you should look for your file somewhere under WinDir, and not in the web application’s folder(s).

    When it comes to debugging such issues, I’d escalate the IIS’ account to local/domain administrator just to see if the problem is solved or not. If it’s solved then there’s a permissions issue here.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 342k
  • Answers 342k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer these two are lightly 'documented' optimizations. http://developer.android.com/guide/developing/tools/aapt.html "... Zip-compatible archives… May 14, 2026 at 5:12 am
  • Editorial Team
    Editorial Team added an answer do console apps run faster than windows based app Short… May 14, 2026 at 5:12 am
  • Editorial Team
    Editorial Team added an answer You can do it by parsing the html by using… May 14, 2026 at 5:12 am

Related Questions

Hi all (before closing based on the title, please read the bottom parragraph), I'm
So, I've got SQL (2005) Transactional Replication generally working well with a single publisher
As an addition to my previous post on Creating a web server in pure
I'm using the Google App Engine in combination with the Google Web Toolkit to
Hey, I'm having an issue seperating packets using a custom binary protocol. Currently the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.