Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
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]

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us