Problem with MailItem.Move

  • Thread starter Thread starter Vedanshu Mandvikar via OfficeKB.com
  • Start date Start date
V

Vedanshu Mandvikar via OfficeKB.com

Hi,

I am creating a mail item and moving it to the outbox folder as shown
below...


MailItem cb = (MailItem)outappclass.CreateItem(OlItemType.MailItem)

Outlook.NameSpace olNs = olApp.GetNamespace("MAPI")

Outlook.MAPIFolder oFolder = olNs.GetDefaultFolder
(Outlook.OlDefaultFolders.olOutBox);


// Some code here to set the various properties of mailitem...

try
{ cb.Move(oFolder);} catch{}

..........
The mail item gets created in Outlook, but when I open Outlook and click on
send recieve....the Item is not sent....In fact nothing happens.. I have to
manually open the mail message and then click on its send button to send
it....

Please help me as I have to soon submit an application based on above.

Thanks

Vedanshu Mandvikar
 
Moving an item to Outbox does nothing but put that item in that folder. It
does not submit it to the transport mechanism. To do that you need to open
the item and send it in the UI or use the Send method of the item.
 
Back
Top