none
Office 365 and Transport Agents RRS feed

  • Question

  • On an Exchange 2013 server I can create an smtpReceiveAgent transport agent to perform the task shown on this page, which is this c# code (VB code is also available on the webpage): -

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Exchange.Data.Transport;
    using Microsoft.Exchange.Data.Transport.Smtp;
    
    namespace MyAgents
    {
        public sealed class MyAgentFactory : SmtpReceiveAgentFactory
        {
            public override SmtpReceiveAgent CreateAgent(SmtpServer server)
            {
                return new MyAgent();
            }
        }
        public class MyAgent : SmtpReceiveAgent
        {
            public MyAgent()
            {
                this.OnEndOfData += new EndOfDataEventHandler(MyEndOfDataHandler);
            }
            private void MyEndOfDataHandler (ReceiveMessageEventSource source, EndOfDataEventArgs e)
    
            {
                // The following line appends text to the subject of the message that caused the event.
                e.MailItem.Message.Subject += " - this text appended by MyAgent";
            }
        }
    }
    

    How can I do something similar on my Office 365 Exchange implementation?

    Thanks, Paul.

    Thursday, September 3, 2015 10:31 AM

All replies