Пример #1
0
        /// <summary>
        /// Gets the next message in the currently opened folder
        /// </summary>
        /// <param name="pMessage">MAPIMessage object</param>
        /// <param name="bUnreadOnly">only get unread messages</param>
        /// <returns>true on sucess</returns>
        public bool GetNextMessage(out MAPIMessage message)
        {
            IntPtr pMessage;

            message = null;
            if (MAPIGetNextMessage(pMAPI, out pMessage))
            {
                message = new MAPIMessage(pMessage);
            }
            return(message != null);
        }
Пример #2
0
        /// <summary>
        /// Gets the next message in this folder
        /// </summary>
        /// <param name="pMessage">MAPIMessage object</param>
        /// <returns>true on success</returns>
        public bool GetNextMessage(out MAPIMessage message)
        {
            IntPtr pMessage;

            message = null;
            if (FolderGetNextMessage(pObject, out pMessage))
            {
                message = new MAPIMessage(pMessage);
            }
            return(message != null);
        }
Пример #3
0
 /// <summary>
 /// Gets the next message in the currently opened folder
 /// </summary>
 /// <param name="pMessage">MAPIMessage object</param>
 /// <param name="bUnreadOnly">only get unread messages</param>
 /// <returns>true on sucess</returns>
 public bool GetNextMessage(out MAPIMessage message)
 {
     IntPtr pMessage;
     message = null;
     if (MAPIGetNextMessage(pMAPI, out pMessage))
     {
         message = new MAPIMessage(pMessage);
     }
     return (message != null);
 }
Пример #4
0
 public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest)
 {
     return FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer);
 }
Пример #5
0
 public bool DeleteMessage(MAPIMessage message)
 {
     return FolderDeleteMessage(pObject, message.Pointer);
 }
Пример #6
0
 /// <summary>
 /// Gets the next message in this folder
 /// </summary>
 /// <param name="pMessage">MAPIMessage object</param>
 /// <returns>true on success</returns>
 public bool GetNextMessage(out MAPIMessage message)
 {
     IntPtr pMessage;
     message = null;
     if (FolderGetNextMessage(pObject, out pMessage))
     {
         message = new MAPIMessage(pMessage);
     }
     return (message != null);
 }
Пример #7
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // To embed images inside of HTML text:
        //		-send a message as usual, setting its HTML text
        //		-add an <IMG tag with src="cid:<contentID>"
        //		-add an attachment using the same CID
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public static void SendCIDTest(NetMAPI mapi)
        {
            if (mapi.OpenOutbox())
            {
                MAPIMessage message = new MAPIMessage();
                if (message.Create(mapi, MAPIMessage.Importance.IMPORTANCE_LOW))
                {
                    message.SetSender("Support", "*****@*****.**");
                    message.SetSubject("Subject");

                    string strCID = "123456789";
                    StringBuilder strImage = new StringBuilder();
                    strImage.Append("<html><body><IMG alt=\"\" src=\"cid:");
                    strImage.Append(strCID);
                    strImage.Append("\" border=0></body></html>");
                    message.SetRTF(strImage.ToString());


                    message.AddRecipient("*****@*****.**");
                    message.AddAttachment(@"c:\Temp\Pic.jpg", "", strCID); // obviously you'll have to supply an image here

                    if (message.Send()) Console.WriteLine("Sent Successfully");
                }
            }
        }
Пример #8
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //
        // To send a message:
        //		-first open up a MAPI session and login
        //		-then open the message store you want to access 
        //		-then open the outbox
        //		-create a new message, set its priority if you like 
        //		-set its properties, recipients and attachments
        //		-call send
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public static void SendTest(NetMAPI mapi)
        {
            if (mapi.OpenOutbox())
            {
                MAPIMessage message = new MAPIMessage();
                if (message.Create(mapi, MAPIMessage.Importance.IMPORTANCE_LOW))
                {
                    message.SetSender("Support", "*****@*****.**");
                    message.SetSubject("Subject");

                    // user SetBody for ANSI text, SetRTF for HTML and Rich Text
                    message.SetRTF("<html><body><font size=2 color=red face=Arial><span style='font-size:10.0pt;font-family:Arial;color:red'>Body</font></body></html>");

                    message.AddRecipient("*****@*****.**");
                    message.AddRecipient("*****@*****.**");

                    if (message.Send()) Console.WriteLine("Sent Successfully");
                }
            }
        }
Пример #9
0
 public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest)
 {
     return(FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer));
 }
Пример #10
0
 public bool DeleteMessage(MAPIMessage message)
 {
     return(FolderDeleteMessage(pObject, message.Pointer));
 }