e-mail through with Outlook Redemption library...
-
Has found one library which allows to send without Outlook Security. But here the problem Who used to it, help me... I try to send together with MAPI
oSession = new MAPI.Session(); oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value); MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox; MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages; MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); SafeMailItem SafeItem = new SafeMailItemClass(); oMsg.Subject = "Hello!"; oMsg.Text = "Hello!"; SafeItem.Item = oMsg; SafeItem.Recipients.Add("xxx@xxx.xxx"); SafeItem.Recipients.ResolveAll(); SafeItem.Send(); oSession.Logoff();
there Was one question: How to make what letters automatically sent, and that they are kept in folder Outbox and do not send yet will not start itself Outlook? -
Has found one library which allows to send without Outlook Security. But here the problem Who used to it, help me... I try to send together with MAPI
oSession = new MAPI.Session(); oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value); MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox; MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages; MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); SafeMailItem SafeItem = new SafeMailItemClass(); oMsg.Subject = "Hello!"; oMsg.Text = "Hello!"; SafeItem.Item = oMsg; SafeItem.Recipients.Add("xxx@xxx.xxx"); SafeItem.Recipients.ResolveAll(); SafeItem.Send(); oSession.Logoff();
there Was one question: How to make what letters automatically sent, and that they are kept in folder Outbox and do not send yet will not start itself Outlook?Im not really understanding exactly what you are needing... but if you are asking if Outlook has to be running for redemption to work, then I would say yes. It has been my experience that the mail will never go through if outlook is not running. I suggest checking for Outlook, and if it is not running, starting the process. When all mail has been sent, then kill the process, or simply leave it open, whichever you prefer. Also, on some versions of Outlook, the mail will stay in the Drafts folder and will not send until the next Send/Receive, despite the solution that the Redemption people give you (SendNow()). Hope that helped Aaron
-
Im not really understanding exactly what you are needing... but if you are asking if Outlook has to be running for redemption to work, then I would say yes. It has been my experience that the mail will never go through if outlook is not running. I suggest checking for Outlook, and if it is not running, starting the process. When all mail has been sent, then kill the process, or simply leave it open, whichever you prefer. Also, on some versions of Outlook, the mail will stay in the Drafts folder and will not send until the next Send/Receive, despite the solution that the Redemption people give you (SendNow()). Hope that helped Aaron
Hello Aaron. I send the letter by means of CDO. It's impossible to use Outlook COM Library for me.. (restriction in a technical project) What i do:
//CDO MAPI.Session oSession = new MAPI.Session(); oSession.Logon(Missing.Value, Missing.Value, true, true, Missing.Value, Missing.Value, Missing.Value); MAPI.Folder oFolder = (MAPI.Folder)oSession.Outbox; MAPI.Messages oMessages = (MAPI.Messages)oFolder.Messages; MAPI.Message oMsg = (MAPI.Message)oMessages.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value); // Redemptoin SafeMailItem SafeItem = new SafeMailItemClass(); oMsg.Subject = "Hello!"; oMsg.Text = "Hello!"; SafeItem.Item = oMsg; SafeItem.Recipients.Add("xxx@xxx.xxx"); SafeItem.Recipients.ResolveAll(); //!!! oSession.DeliverNow(); //!!! MAPIUtils ut = new MAPIUtilsClass(); ut.DeliverNow((int)rdoFlagIcon.olRedFlagIcon, (int)this.Handle); SafeItem.Send(); oSession.Logoff();
Letters remain in a folder Proceeding... And how to make that they have automatically gone and have got in folder Sent? I can not understand in what a problem. !!! - this code don't help...