|
|
 Prize winner in Competition
"MFC/C++ Nov 2004"
Comments and Discussions
|
|
 |

|
hi,
this article is very helpful.
i want to set rtf data to a mime message
how can i do that?
for setting html data to a mime message my code snippet is like this:
what change i need to do to set rtf data to the mime message body?
or
first i need to convert rtf data to html data?
code snippet:
*********************************************************************
// set html data to a mime message
CoInitialize(NULL);
IMessage* pMsg = NULL;
IBodyPart* pBp = NULL;
IConfiguration* pConfig = NULL;
Fields* pFlds = NULL;
Field* pFld = NULL;
_Stream* pStm = NULL;
HRESULT hr = S_OK;
hr=CoCreateInstance(
__uuidof(Message),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IMessage),
(void**)&pMsg);
pMsg->put_To(_bstr_t("\"Some One\" <example@example.com>, \"Another\" <another@example.com>"));
pMsg->put_From(_bstr_t("\"ThirdPerson\" <exampleuser3@example.com>, \"Fourth\" <exampleuser4@example.com>"));
pMsg->put_Sender(_bstr_t("\Finally\" <example@example.com>"));
pMsg->put_Subject(_bstr_t("Files for Monday's meeting."));
pMsg->put_MimeFormatted(VARIANT_FALSE);
char*pch=NULL;
CFile file;
file.Open("c:\\me.html",CFile::modeRead);
int xx = file.GetLength();
pch = (char*)calloc(1,xx+1);
file.Read(pch,xx);
file.Close();
IBodyPart *bodyPart;
pMsg->get_BodyPart(&bodyPart);
bodyPart->put_ContentTransferEncoding(_bstr_t("quoted-printable"));
pMsg->put_HTMLBody((unsigned short*)pch);
free(pch);
pch=NULL;
pMsg->GetStream(&pStm);
pStm->SaveToFile(L"c:\\me.eml",adSaveCreateOverWrite);
pStm->Release();
pMsg->Release();
CoUninitialize();
*********************************************************************
|
|
|
|

|
I want to know how I can find a list of my contacts in Outlook?
it looks a bit like what you did to access local files but how do I find my contacts in Outlook?
thank you
|
|
|
|

|
Hi, sorry to interrupt you. I am really feazed by the coding on the outlook express.
I am developing my application using C++ with the help of NKT WAB .And i've downloaded the NKT WAB V2.1.0 Source Code.
I appreciated you so much for your great work!!
The problem is that i don't know how to add contacts into my OE group in my application,
although i see in the source code that it is appending the EntryId of the existing contact to the DistList.
Now i can get the DistributionListArray by the property of PR_DISTLIST_ENTYRIDS and then create the new "lpProp" of LPSPropValue type.
So how can i set the new "lpProp" as the value of the tag "PR_DISTLIST_ENTRYIDS" of my OE group?
In the source code, it is done by "SetField(lpProp)" and i am puzzled by the global varialbe "_changeProps" of "PropMap" type in the function of SetField();
because i can't find any initalization of the varialbe "_changeProps" in the context. Is it releate to COM? but i know little about it....
So the key is that how can i retrieve "_changeProps" ?
if i get it, maybe i can i set the new "lpProp" as the value of the tag "PR_DISTLIST_ENTRYIDS" of my OE group.
Addtional, it failed when i use "lpDistList->SetProps(1, lpProp, NULL)" ;
So could you please give me anytips or methods about that?
I’m hopeful you can help my out, and any support is appreciated.
Thanks again and best wishes to you. ^_^
The below is my C++ source code of this part:
if(lpContactEntryID)
{
HRESULT hr = E_FAIL;
LPSPropValue lpOldProp;
LPSPropValue lpProp;
SBinary *lpBin, *lpOldBin;
SBinaryArray *lpOldValue;
int cValues = 1;
ULONG arraySize = 0;
lpOldProp = GetDistributionListArray(lpDistList);
lpOldValue = &lpOldProp->Value.MVbin;
if(lpOldValue)
{
cValues = lpOldValue->cValues + 1;
lpOldBin = lpOldValue->lpbin;
}
hr = m_lpWABObject->AllocateBuffer(sizeof(SPropValue), (LPVOID *) &lpProp);
hr = m_lpWABObject->AllocateMore(sizeof(SBinary)*cValues, lpProp, (LPVOID *) &lpBin);
lpProp->dwAlignPad = 0;
lpProp->ulPropTag = PR_DISTLIST_ENTRYIDS;
lpProp->Value.MVbin.cValues = cValues;
lpProp->Value.MVbin.lpbin = lpBin;
for(int i=0; i<(int)cValues; i++)
{
if(lpOldValue && i < (int)lpOldValue->cValues)
{
m_lpWABObject->AllocateMore(lpOldValue->lpbin[i].cb, lpProp, (LPVOID *) &lpBin[i].lpb);
lpBin[i].cb = lpOldValue->lpbin[i].cb;
memcpy(lpBin[i].lpb, lpOldValue->lpbin[i].lpb, lpOldValue->lpbin[i].cb);
}
else
{
m_lpWABObject->AllocateMore(cbContactEntryID, lpProp, (LPVOID *) &lpBin[i].lpb);
lpBin[i].cb = cbContactEntryID;
memcpy(lpBin[i].lpb, lpContactEntryID, cbContactEntryID);
}
}
if(lpOldProp)
{
m_lpWABObject->FreeBuffer(lpOldProp);
}
hr = lpDistList->SetProps(1, lpProp, NULL);
|
|
|
|

|
How can I manipulate contacts in outlook express 6
If it is out of scope of this article then please give some hint so I can find the way.
|
|
|
|

|
Hello,
I want to detect switch identity event of Outlook express.
whenever any user do switch identity is there is any special message or any other way to trap event.
Thanks,
Jitendra
|
|
|
|

|
i was using this code to delete message from outlook express , in windows mail upto finding duplictae (scnning msg from selected folder and deleting =code added by me) was working fine but when it come to delete it gives error ,E_INVALIDARG is return value of deletemessge function.
this is realy important to me
Please advise .
note: in same type of question it is advise to change flag of message but setflag function do not have value specified in solution
Regards
Rupal
|
|
|
|

|
Hi,
I"m using a programme to extract all information of emails from Outlook xpress.
On Visat and XP, no problem, but on Windows 2000, when reading some emails from outlook Xpress, I have an error with
Hres = pFolder->OpenMessage(mprops.dwMessageId, IID_IMimeMessage, (VOID **) &pMimeMessage);
pMimeMessage was declared like that:
IMimeMessage* pMimeMessage = NULL;
The error I have is : Unhandled exception.
That happend with some emails. When reading previous email from same folder, not problem.
Have you any idea ? pFolder is correct, mprops too
Alain
|
|
|
|

|
I ran the demo application on a Windows XP system that has two Outlook Express identities, each protected by a password. The demo didn't need the password to access the mail belonging to the main identity.
Two questions:
- Any idea what to change in your code to make it password-sensitive?
- Any idea how to switch to another identity?
Nico
|
|
|
|

|
I was able to import the project directly into VS2008.
No dramas.
Project built OK and seems to be running OK.
Been looking for an Outlook Express API as need for XP Embedded.
Thx David JOnes
|
|
|
|

|
Pablo,
do you know how to access the windows Live mail or Windows Mail of Vista, messages and properties. Messages are ascii files but the properties of the messages such as read etc are not documented that I can tell.
|
|
|
|

|
I can't find CoUninitialize().
I'll feel dumb if it's there. I thought I saw it in creation and destruction code but I can't see it
|
|
|
|

|
Your demo application works well when it is launched manually.
But when it is launched using the window service, it fails to get the messages.
Is there any thing required in interaction with the window service.
Regards,
Shail2k4
|
|
|
|

|
Hi,
Nice article Posted.
I am trying to add the email addresses in to the "block sender list" of Outlook express 6.
Can you tell me how I do that ?
Waiting for the expert reply.
Regards,
Idrees.
|
|
|
|

|
hi,
can you tell me how to use your program to create a .dbx file at a specified location.
i don't want to show this folder to be appear in the current outlook express profile
|
|
|
|

|
In Outlook Express 6, there is an attribute "att:athena-server" which contains the domain from which the message was received.
However I don't see it windows vista. I see Windows Mail does display the account from which the message was received, so they do keep the account info. In addition, in the message storage (in the edb file under Windows Mail) I do see the domain too.
Is there a way to get the domain?
I was thinking maybe they save it as Unicode, but I was not able to get the IMimeMessageW to work (which would allow me to use GetPropW). I did not find that interface in the registry, and I do have the inetcomm.dll version 6, which should have it.
Thanks
Joe
|
|
|
|

|
I'd like to modify a message when a user clicks Send button. I thought it would be easy by hooking IStoreFolder like it was described here in comments regarding IMessageList. But I see it's not possible to instantiate IStoreFolder using CoCreateInstance so I can't patch vftable of IStoreFolder and replace eg. CreateStream(). Any ideas?
|
|
|
|

|
Hi,
why in Outlook Express for Windows XP all of changes in reports are saved,
void CMessageTreeDlg::OnButtonSaveChanges()
{
HRESULT hr;
hr = m_pMimeMsg->Commit(COMMIT_REUSESTORAGE);
and in Microsoft Windows Mail for Windows Vista m_pMimeMsg->Commit returns it is said no in access and no changes?
thank you
|
|
|
|

|
Hi, I have a requirement to modify headers for every email that is sent using Outlook Express. I use a hidden window in a DLL to receive WM_NEWMSGS notification on the special folder OUTBOX. Below code excerpt is used to modify the header after opening the mime message <code>hr = pFolder->OpenMessage(msgId, IID_IMimeMessage, (LPVOID*) &m_pMimeMsg); hr = m_pMimeMsg->GetBody(IBL_ROOT, 0, hBody); propValue.vt = VT_LPSTR; propValue.pszVal = (LPSTR) m_pAllocator->Alloc(5); strcpy(propValue.pszVal, "false"); hr = m_pMimeMsg->SetBodyProp(hCurBody, "MyProperty1", NOFLAGS, &propValue); m_pAllocator->Free(propValue.pszVal); propValue.vt = VT_LPSTR; propValue.pszVal = (LPSTR) m_pAllocator->Alloc(5); strcpy(propValue.pszVal, "false"); hr = m_pMimeMsg->SetBodyProp(hBody, "MyProperty2", NOFLAGS, &propValue); m_pAllocator->Free(propValue.pszVal); hr = m_pMimeMsg->Commit(COMMIT_REUSESTORAGE);</code> The above code excerpt seems to be working fine for all mails, that contain an attachment lesser than 1meg. How ever for attachments over 1meg this fails. Can any one out here tell me what does Outlook Express do after the commit. Is there any thing missing from the code above. Regards, Hemadri
|
|
|
|
|

|
Hi,
is there a way to using this project, written in Vc++, with my
project write in C#.
I retreive ad error while adding a reference.
Why?
Tnky
|
|
|
|

|
click the "set content" Button or "delete" button or "save changes" button,the content of the mail currently operated doesn't change.I have a project that must
modify a mail's content via programming, any one have good solution to modify the content of a mail in oe or windows mail please email me ,my email is fangqing0827@126.com,my msn is fangqinghust@hotmail.com,thanks
|
|
|
|

|
Hi,
this is really a great solution
But I'm curious if it is possible to modify an existing message simular as in MS Outlook?
Thank you for any help ..
-- modified at 8:58 Tuesday 21st August, 2007
|
|
|
|

|
Hi ,
I want to access Outlook express mails when the application is run in service mode.When i run the application in service mode it gives me some default folder list not the actual one.Please let me know if it is possible
Thanks in advance
Regards
Kris
|
|
|
|

|
HRESULT hr = m_pStoreNamespace->OpenFolder(..., &pFolder);
hr is E_FAIL, and description is "Unspecified error".
It happens, if is the IMAP folders.
And it happens in OS Windows Vista.
How can I resolve that trouble?
And I have second question: how can I get information that is IMAP folders?
Thanks.
Dieter
|
|
|
|

|
Hi
Developping Windows Mail plugin on the new Vista, I have a problem with this function (that I don't have with others Windows OS and Outlook Express!) :
=> hr = m_pNamespace->RegisterNotification( 0, m_hWnd );
It doesn't succeed and return COM error : -2147467263 (E_NOTIMPL). One more thing: other methods works properly. Does anybody knows what is the trick here?
Best regards
|
|
|
|

|
I would like to do a bulk save attachments on any folfer or folders in Outlook Express to hard drive but leave a mark in the email pointing to where the attachment went. Would be nice to be able to choose the attachment typeto operate on, say *.jpg or *.*, or *.whatever.
I'm not much of a coder and I've downloaded a couple of programs to save attachments but none leave a link behind. Just looking to reduce my mail file size but keep the info around and easily accessabile.
Doable?
B.Worth baworth@hotmail.com
|
|
|
|
|

|
Hi..
I want to create folder in outlook express instead of create sub folder that u provide in the source code... so what I need to change in the code to create folder like Inbox,Outbox... not create sub folder...
I m waiting your reply
|
|
|
|

|
I want to save mail attachments, with the help of code. Plz help me...
VIPLAV AGARWAL
|
|
|
|

|
if u have some idea then give me , how we can read .dbx file and deleted mail from outlook express.
naveen padiyar
|
|
|
|

|
Hi,
The article was very nice but it is in C++. Can i have sample code for Outlook bounced emails.
Here I'm posting sample code:
ApplicationClass myOutlookApplication = new ApplicationClass ();
NameSpace myNameSpace = myOutlookApplication.GetNamespace("MAPI");
object myMissing = System.Reflection.Missing.Value;
myNameSpace.Logon(ConfigData.MailServer as object, myMissing, false, true);
MAPIFolder theInbox = myNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
for (int i=theInbox.Items.Count-1; i -1) ||
(senderEmail.IndexOf("mail delivery subsystem") > -1) ||
(subject.IndexOf("returned") > -1) )
{
Read attachments and look for specific string here..
}
..
thank you,
Regards
ParsiB
|
|
|
|

|
Hi Pablo,
I am able to create an instance of IMimeMessage using CoCreateInstance(). How to use this IMimeMessage interface pointer to read an EML file?
Any help in this direction would be great.
Thanks,
Prasad
|
|
|
|

|
Hi,
Where can i get the iid, clsid, and interface of the IMimeMessageW?
Thanx
|
|
|
|

|
Hi Pablo,
This is a very great article, probably the only one that shows how to use OE interfaces provided by MS.
But, I want to write message event handlers for OE. The requirement is:
1.) When I compose a new mail in OE and press 'Send' button then before the compose window is closed I want to take control of message by obtaining the messageID. I want to scan for any attachments, zip the attachments then remove original attachments from mail and put back the zipped one.
2.) When user tries to read a new mail then I would like to take control over the message, get the messageID, scan for any .zip attachment, unzip the file then remove the .zip file from mail, put back the extracted files to mail and let OE render the mail.
In short, I want to manipulate the composed message before it is sent and also manipulate the message in Inbox before it is displayed.
I don't want to do any UI hooking/hacking here. I want to do it cleanly by using the interfaces you mentioned here.
|
|
|
|

|
i read your article, i learn much thing from the article.Thank you!
i find the project don't wirte a HTML email into express,but i want do it.
can you tell me how to write a HTML email into express? Thank you.
|
|
|
|

|
Hi,
Great article. I prefer OE for email but it's spam filtering is worthless. I'm looking for articles like this to get me started on writing OE plugins so that I can make my own. Thanks.
But, how do you implement drag/drop of messages? I've previously written an OE app which processed messages but the user has to drag-n-drop the messages to a folder and then the files to the app. I would like to allow them to drag-n-drop the messages staright from OE to the app.
Thanks a lot.
--
Synetech
|
|
|
|

|
thanks for your a very use full app
i would like to load all messages programmatically from my mailbox yahoo;
as I do with menu item "receive&send" email in outlook,
is-it possible ? Witch interface to invoke ?
sorry for my bad english,
tanks so much.
-- modified at 1:04 Wednesday 19th July, 2006
|
|
|
|

|
This is a great artical, probably the best artical I found so far related to outlook express.
I'd like to add a menu to outlook express. Any suggestions?
Thanks.
--Yajun
|
|
|
|

|
Is there an efficient method of determining if a email message contains any attachments?
According to the documentation dwFlags in the MESSAGEPROPS specifies the state of the message. One of the states is IMF_ATTACHMENTS - Indicates that the message has attachments. Unfortunately every message dwFlags is zero?
Thanks in advance.
Danny
|
|
|
|

|
We need to automate the outlook express 6 for reading folders etc. We could not get any good article than yours. The article is very good.
how can this be carried out using Visual Basic 6.0? Can we reference your code from VB?
any help on this is appreciated.
kram
|
|
|
|

|
Hi,
I'm currently programming a win32 service and need to retrieve local user(s) OE folders and message.
But when I execute your code from within my service it only retrieve System's user folders (default OE folders). Is there a way to specify that we want to access another user's folders. Please give me hints or tell me I can't do it !
Thanks a lot.
|
|
|
|

|
Hi Pablo, great article
I want to extract the attachments from the e-mails and for this I'm using IMimeBody interface. Until here no problem I was able to extract them successfully.
The problems occurs when I'm using the UNICODE version of my program. I'm not able to get the filenames correctly. Do I have to use the UNICODE version of the interface IMimeBody - IMimeBodyW? If so do you in which header is declared? It seems that is not in the mimeole.h. Or do I have to find a newer version of this header.
Thanks,
|
|
|
|

|
This is a great article.
Can anybody give me an idea to get the selected message Id to get all the information for the e-mail selected in Inbox or any other folder selected.
Thanks in advance.
Advaitha P
|
|
|
|

|
Do you know the changes MS is making re: the change from OE to the Windows Mail product?
I am very interested in knowing about password encryption. How is it handled in OE and what might it change to in Vista.
do you know about OE and password cryptography?
any info would be warmly welcomed. thx!
George
thanks so much,
george
GSLockwood@gmail.com
|
|
|
|

|
Is it possible also to list/enumerate/access these folders via IStoreNamespace interface? Or, is any other solution exists for it?
I've find the way how to list/retrieve any messages from current folder. I know how retrieve currently selected/focused messages (using officially undocumented IMessageList and IMessageTable interfaces).
But it seems that actually documented API is very poor in terms of possibilities.
It is possibly to emulate MS Outlook's "PickFolder" method (for interactive selection of a folder) by virtually invoking "Goto folder" action (Ctrl+Y) and returning to previously selected folder immediately after that. In this case you'll get FOLDERID of _any_ (not only local) folder.
The question is, however, how to get access to non-local folder in the background - i.e., not interactively.
|
|
|
|

|
Hello,
This is pretty nice help.I have searched two hours in GOOOGLE.But this is the only nice help.Please can you provide a dotnet implimentation of this.Or please refer me some URL if i wanna do this in dotnet.
Kashif Hameed
|
|
|
|

|
Does MS Outlook Express have the same message format of MS Outlook 2003?
me
|
|
|
|

|
i learn much thing from the article.
thanks.
|
|
|
|

|
From this source code, How can I get exact body from buffer????
code snippet from source code:
hr = m_pStoreFolder->OpenMessage(dwSelMsg, IID_IStream, (VOID **) &pTextStream);
hr = pTextStream->Read(buffer, sizeof(buffer)-1, &ulReaded);
Thanks in advance.
Regards,
Durga.
|
|
|
|

|
Hello,
How to work with it with console?
Please show the code.
Thank you
Ensam
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article was done to provide an example of IStoreNamespace / IStoreFolder.
| Type | Article |
| Licence | |
| First Posted | 28 Dec 2004 |
| Views | 334,869 |
| Bookmarked | 104 times |
|
|