Outlook 2002 empty body in Sent Items folder

K

kireetgajera

Hi. All

I am using VC++ 6.0.

Using Outlook object, I have load .msg file in my Outlook Outbox folder
and send it..

It works fine in Outlook 2003, 2000, but it creates problem in Outlook
2002, i.e. when in puts sent mail in sentItem folder, the body of that
mail is empty !!!!! (very strange).. But, the actual recipient gets the
complete body.

But, On other machine having 2002 it works fine, no problems..

So, is there any setting to make in Microsoft Outlook 2002 or something
in my code..

My Code :
=================================================================
CoInitialize(NULL);
HRESULT hr;

RecipientsPtr p = NULL;


_ApplicationPtr pOutlook = NULL;
_MailItemPtr pMailItem = NULL;


try
{
hr = pOutlook.CreateInstance("Outlook.Application");
if(FAILED(hr))
throw hr;


_bstr_t bstrPath(strPath);

pMailItem = pOutlook->CreateItemFromTemplate(bstrPath);


if(strTo.IsEmpty()==FALSE)
{
bstr_t bstrTo(strTo);
hr = pMailItem->put_To(bstrTo);
if(FAILED(hr))
throw hr;
}

hr = pMailItem->raw_Send();
if (FAILED(hr))
throw hr;


}
catch(...)
{

if(pOutlook != NULL)
{
pOutlook.Release();
pOutlook = NULL;
}

if(pMailItem != NULL)
{
pMailItem.Release();
pMailItem = NULL;
}

if(p != NULL)
{
p.Release();
p = NULL;
}

::CoUninitialize();
return;
}

pOutlook.Release();
pOutlook = NULL;

pMailItem.Release();
pMailItem = NULL;

p.Release();
p = NULL;

::CoUninitialize();
return;
=================================================================

Please help me, it's very urgent...

Thanks in Advance..

Kireet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top