Exemplo n.º 1
0
        /// <summary>
        /// Raises event GetMessageStoreStream.
        /// </summary>
        /// <param name="session">Reference to calling SMTP session.</param>
        /// <returns></returns>
        internal GetMessageStoreStream_eArgs OnGetMessageStoreStream(SMTP_Session session)
        {
            GetMessageStoreStream_eArgs eArgs = new GetMessageStoreStream_eArgs(session);

            if (this.GetMessageStoreStream != null)
            {
                this.GetMessageStoreStream(this, eArgs);
            }
            return(eArgs);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises event GetMessageStoreStream.
 /// </summary>
 /// <param name="session">Reference to calling SMTP session.</param>
 /// <returns></returns>
 internal GetMessageStoreStream_eArgs OnGetMessageStoreStream(SMTP_Session session)
 {
     GetMessageStoreStream_eArgs eArgs = new GetMessageStoreStream_eArgs(session);
     if(this.GetMessageStoreStream != null){
         this.GetMessageStoreStream(this,eArgs);
     }
     return eArgs;
 }
        /// <summary>
        /// Is called by SMTP server if server needs to get stream where to store incoming message.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Event data.</param>
        private void SMTP_Server_GetMessageStoreStream(object sender,GetMessageStoreStream_eArgs e)
        {
            if(!Directory.Exists(m_MailStorePath + "IncomingSMTP")){
                Directory.CreateDirectory(m_MailStorePath + "IncomingSMTP");
            }

            e.StoreStream = new FileStream(API_Utlis.PathFix(m_MailStorePath + "IncomingSMTP\\" + Guid.NewGuid().ToString().Replace("-","") + ".eml"),FileMode.Create,FileAccess.ReadWrite,FileShare.ReadWrite);
        }