|
|
|
date: Mon, 5 Jun 2006 18:44:41 +0200,
group: microsoft.public.exchange.development
back
How to restore email
Hello all,
I have email saved in eml format. User deleted this email.
I would like to restore this email in user mailbox.
I wrote this piece of code. But email is showed in outlook as concept of email. I would like to show email like sent/received email.
Any help is appreciated.
m_Conn.Open(m_sURLFolder, m_sLoginUsername,m_sLoginPWD,-1);
CDO.Message msg = new CDO.MessageClass();
ADODB.Stream stream = new ADODB.StreamClass();
// Open empty stream
stream.Open(Missing.Value,ADODB.ConnectModeEnum.adModeUnknown,ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified ,String.Empty ,String.Empty);
stream.LoadFromFile(sPathEML);
stream.Flush();
msg.DataSource.OpenObject(stream, "_Stream");
msg.DataSource.Save();
ADODB.Fields Flds = msg.Fields;
Flds["urn:schemas:mailheader:keywords"].Value = m_sMsgTagKeyword;
Flds.Update();
msg.DataSource.Save();
msg.DataSource.SaveTo(m_sURLFolder "//" id ".eml",m_Conn,ADODB.ConnectModeEnum.adModeReadWrite,ADODB.RecordCreateOptionsEnum.adCreateNonCollection, ADODB.RecordOpenOptionsEnum.adOpenSource, m_sLoginUsername ,m_sLoginPWD
date: Mon, 5 Jun 2006 18:44:41 +0200
author: Jan Solarek
Re: How to restore email
You might want to include setting the PR_MESSAGE_FLAGS property which will
make the message appear as a sent or received item instead of a draft. eg
something like this should work okay
..Fields("http://schemas.microsoft.com/mapi/proptag/x0E070003") = 3
..Fields.update
Cheers
Glen
"Jan Solarek" wrote in message
news:%23nLsw8LiGHA.3900@TK2MSFTNGP05.phx.gbl...
Hello all,
I have email saved in eml format. User deleted this email.
I would like to restore this email in user mailbox.
I wrote this piece of code. But email is showed in outlook as concept of
email. I would like to show email like sent/received email.
Any help is appreciated.
m_Conn.Open(m_sURLFolder, m_sLoginUsername,m_sLoginPWD,-1);
CDO.Message msg = new CDO.MessageClass();
ADODB.Stream stream = new ADODB.StreamClass();
// Open empty stream
stream.Open(Missing.Value,ADODB.ConnectModeEnum.adModeUnknown,ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified
,String.Empty ,String.Empty);
stream.LoadFromFile(sPathEML);
stream.Flush();
msg.DataSource.OpenObject(stream, "_Stream");
msg.DataSource.Save();
ADODB.Fields Flds = msg.Fields;
Flds["urn:schemas:mailheader:keywords"].Value = m_sMsgTagKeyword;
Flds.Update();
msg.DataSource.Save();
msg.DataSource.SaveTo(m_sURLFolder + "//" + id +
".eml",m_Conn,ADODB.ConnectModeEnum.adModeReadWrite,ADODB.RecordCreateOptionsEnum.adCreateNonCollection,
ADODB.RecordOpenOptionsEnum.adOpenSource, m_sLoginUsername ,m_sLoginPWD );
date: Tue, 6 Jun 2006 08:23:05 +1000
author: Glen Scales [MVP]
|
|