Menu

Capturing SMTP conversation

samh12
2005-08-02
2013-04-02
  • samh12

    samh12 - 2005-08-02

    Hi,
    Is it possible after the send to capture the SMTP conversation?  The send method just returns True/False but is this stored somewhere?

    Cheers
    Steve.

     
    • Mike Bridge

      Mike Bridge - 2005-08-03

      Hi-

      Not yet, but I'll add that into the next revision which is coming Really Soon Now.  It's sort-of there now, but I'll make it easier to use in the next release.

      -Mike

       
    • Mike Bridge

      Mike Bridge - 2005-08-04

      Hi-

      Ok, this is feature is updated in 0.5.3b:

         smtpserver.CaptureSmtpConversation=true;
         emailmessage.Send(smtpserver);
         String tmp=smtpserver.GetSmtpConversation();

      Thanks for the suggestion!

      -Mike

       
      • Oleg Deribas

        Oleg Deribas - 2005-08-26

        Wouldn't it be better to have events like SmtpSringSent and SmtpStringReceived ?

         
        • Mike Bridge

          Mike Bridge - 2005-08-26

          Hi-

          Yes, that certainly would be more elegant.  That way, you could register arbitrary loggers without having to switch to a "debug" mode and potentially creating a large buffer in memory.  If I ever get around to abstracting the logging component, I'll set that up.

          Thanks for the suggestion!

          -Mike

           
    • Ron

      Ron - 2005-09-29

      If an Smtp object is used to send multiple emails is the conversation buffer cleared between each one? Should there be a setting for that? I think it should maintain the buffer and a ClearSmtpConversation() should be added to allow the user to clear the buffer between calls to:

      emailMessage.Send(smtp);

       
      • Mike Bridge

        Mike Bridge - 2005-09-29

        Hi-

        I've been thinking I'll make thinks like these possible by deprecating the existing debugging mechanism (which is kind of hacky) and providing some event handler delegates that will allow people to implement their own custom logging.  That way, it would be possible to capture pretty much anything having to modify the main code body.

        Hopefully, next release.

        Thanks!

        -Mike

         
    • Ron

      Ron - 2005-09-29

      I also think it would be nice if there were a timestamp on each line of the conversation:

      9/29/2005 12:26:39 AM READ> 220 test.com ESMTP
      9/29/2005 12:26:40 AM SENT> EHLO test

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.