CDO mail header setting please help
-
hi, this is a part of a mail function that uses CDO. function works well with normal fields & settings and sends mail very good but i cound not set the header part of a e-mail. so , Importance is one of headers that i want to set . but it does not work could you help me to set importance header with this code block. the bold part of code what i did so far but no succeed. thanks in advance note: i did not add whole function because it is too long -------------------------------------------------------- CoInitialize(NULL); HRESULT hr = NULL; IMessage *pMsg; IConfiguration *pConfig; Fields *pFields; Field *pField; hr = CoCreateInstance(__uuidof(Message), NULL,CLSCTX_INPROC_SERVER,__uuidof(IMessage),reinterpret_cast<void**>(&pMsg)); hr = CoCreateInstance(__uuidof(Configuration), NULL,CLSCTX_INPROC_SERVER,__uuidof(IConfiguration),reinterpret_cast<void**>(&pConfig)); pConfig->get_Fields(&pFields); COleVariant sFname((LPCTSTR)"urn:schemas:mailheader:Importance"); pFields->get_Item(sFname.Detach(),&pField); COleVariant sImportance((LPCTSTR)"high"); pField->put_Value(sImportance.Detach()); pFields->Update(); pMsg->put_Configuration(pConfig); hr = pMsg->Send(); if (FAILED(hr)) { _com_error err(hr); szReturnVal = err.ErrorMessage(); } if (pFields) { pFields->Release(); } if (pField) { pField->Release(); } if (pMsg) { pMsg->Release(); } if (pConfig) { pConfig->Release(); } CoUninitialize();