C
chill
Hi guys,
I faced wierd behavior as for me from Ol2002.
The problem:
I am trying to put html in newly created mailitem - what can be easier, but
not for Ol2002. Setting HTMLBody property works in all versions but not here
- when I set it and saved mail item it is turns to default html code for new
mailitem.
code:
CComPtr<Outlook::_MailItem> item;
m_spApp->CreateItem(olMailItem, (IDispatch**)&item);
item->put_To(email.bstrVal);
....
std::string bodyTag = "<body>";
int startIndex = tmpBuf.find(bodyTag);
std::string replaceStr = bodyTag + (char*)body + "\n";
body = (tmpBuf.replace(startIndex, bodyTag.length(), replaceStr)).c_str();
....
item->put_Subject(subject.bstrVal);
item->put_HTMLBody(body);
....
item->Save();
....
the code works - until it is viewed in Outlook(there I can view empty
message - default html).
May be I missed some bug fixes in Ol2002 or what can this be?
Great thanks if someone knows what is going on.
Regards,
_maximus_
I faced wierd behavior as for me from Ol2002.
The problem:
I am trying to put html in newly created mailitem - what can be easier, but
not for Ol2002. Setting HTMLBody property works in all versions but not here
- when I set it and saved mail item it is turns to default html code for new
mailitem.
code:
CComPtr<Outlook::_MailItem> item;
m_spApp->CreateItem(olMailItem, (IDispatch**)&item);
item->put_To(email.bstrVal);
....
std::string bodyTag = "<body>";
int startIndex = tmpBuf.find(bodyTag);
std::string replaceStr = bodyTag + (char*)body + "\n";
body = (tmpBuf.replace(startIndex, bodyTag.length(), replaceStr)).c_str();
....
item->put_Subject(subject.bstrVal);
item->put_HTMLBody(body);
....
item->Save();
....
the code works - until it is viewed in Outlook(there I can view empty
message - default html).
May be I missed some bug fixes in Ol2002 or what can this be?
Great thanks if someone knows what is going on.
Regards,
_maximus_