Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDO mail header setting please help

CDO mail header setting please help

Scheduled Pinned Locked Moved C / C++ / MFC
announcementhelpworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    only_jack
    wrote on last edited by
    #1

    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();

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups