473,698 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save MAPI.Message as File

Hi,

This is the first time I've posted something on here.
I've looked around the web for hours and failed miserably. Hopefully
someone out there would be able to help.
I'm trying to save an MApi.Message (which represents an email) object
to my hard or a network drive drive as an MSG file but I'm getting
nowhere. I know I
can use Redemption to do this but I'm trying to avoid 3rd party
products (especially ones I have to pay for)

Here's my code

------------------------------------

MAPI.Session oSession = new MAPI.Session();
MAPI.Folder oFolder;
MAPI.Messages oMessages;
MAPI.Message oMessage;
string strEmailAccount = "Exchange_Email _Account";
string strExchangeServ erName = "exchange04 ";
object profile = null;
string strProfile = strExchangeServ erName + Constants.vbLf +
strEmailAccount ;
oSession.Logon( "", , , false, , true, strProfile);
oFolder = oSession.Inbox;
oMessages = oFolder.Message s;
oMessage = oMessages.Item( 2);

----------------------------------------------

Your help will be appreciated!

Thanks
Jun 27 '08 #1
3 3419
On Fri, 18 Apr 2008 01:30:30 -0700, Nabil <ny*****@gmail. comwrote:
[...]
I'm trying to save an MApi.Message (which represents an email) object
to my hard or a network drive drive as an MSG file but I'm getting
nowhere.
Sorry to say, I'm not sure this newsgroup is going to be a great place to
get your answer. If the MAPI.Message object includes some sort of
"Save()" method that automatically writes the file format you're looking
for, then that's obviously the way to go. However, I have to assume that
since you're posting here you've already verified no such method exists (I
certainly don't know myself one way or the other).

I suppose it's possible that the MAPI namespace itself includes some class
with a static method that could do the job, but that seems like more of a
long shot, and in any case again...it seems unlikely that the expertise
for knowing the answer off the top of one's head probably doesn't exist in
this newsgroup.

Barring that, you're probably going to have to figure out the MSG file
format yourself, extract the data from the Message object, and write out
the message file yourself. But again, not much help would exist in this
newsgroup for that.

Basically, your question has practically nothing at all to do with C# (the
nominal topic of this newsgroup), and relatively little to do with .NET
(technically off-topic, but de facto within the scope of the newsgroup).
You really need to find a forum specifically targeted at the interop API
for messaging, or maybe even Office (I realize it's not Office per se, but
the MSG format I think is, and in any case you're much more likely to run
across people with experience in this area in such a forum).

And no, I don't know off-hand where those forums are. But surely they are
out there. :)

Sorry for not being more helpful.

Pete
Jun 27 '08 #2
Thanks a lot for taking the time to reply.

There's no Save() method in Mapi.Message but I will double check the
MAPI namespace. I'll also look for a group that specifically
addresses MAPI.

Cheers

Nabil
Jun 27 '08 #3
thd
On Mon, 21 Apr 2008 01:15:32 -0700, Nabil wrote:
Thanks a lot for taking the time to reply.

There's no Save() method in Mapi.Message but I will double check the
MAPI namespace. I'll also look for a group that specifically addresses
MAPI.

Cheers

Nabil
I recommend microsoft.publi c.win32.program mer.messaging

Tom Delany
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
4823
by: Chris | last post by:
I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I call Resolve() and Send(), I get confirmation dialogs. I will be sending out quite a few e-mails at a time, and would rather not have the user have to click yes for every single one. Does anyone know a workaround? I know about smtplib, but I...
1
8834
by: V.C.Sekhar | last post by:
Hi there, Can any one please help in getting me Python-Outlook programming issue clarified. I just wanted to do the following using Python: 1)Open a New Oulook Mail Window
2
3358
by: Larry Eaton | last post by:
According to MSDN there is MAPI example code in a file SIMPLE.CLI I cannot locate this file. Can anyone direct me to the location of this? It doesn't appear to be anywhere in ftp://ftp.microsoft.com/developr/mapi/samples
3
2844
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
0
1616
by: jackiewkc | last post by:
Hi, Does anyone know how to use VB to write a simple MAPI to save email attachments from a specified email address to my hard drive? What I basically want is that everytime when I receive an email from a particular sender, the MAPI will save the attachment to a particular location on my box automatically. (I am using outlook 2003) Thanks.
1
2852
by: bobh | last post by:
Hi All, I've been using this function which I got from here for some time now in two of my AccessXP multiusers applications and it has worked without issue until lately it has stopped functioning on several user pc's and I don't know why. I've asked our PC Services group what they changed on the pc's that this does not work on and they say 'nothing'. Well something has changed cause this did work at one time. When I step thru it in...
3
3609
by: Nabil | last post by:
Hi, This is the first time I've posted something on here. I've looked around the web for hours and failed miserably. Hopefully someone out there would be able to help. I'm trying to save an MApi.Message object (which represents an
1
2161
by: Nabil | last post by:
Hi, This is the first time I've posted something on here. I've looked around the web for hours and failed miserably. Hopefully someone out there would be able to help. I'm trying to save an MApi.Message (which represents an email) object to my hard drive or a network drive but I'm getting nowhere. I know I can use Redemption to do this but I'm trying to avoid 3rd party
15
8374
by: squrel | last post by:
Hi everyone.. i need ur help once more time.... i have a form called reminder..in tht form i have: txtid, txtcaseid, txtreminder, cmbremindby(system or user), txtremindto, dtpreminddt, MAPISession1, MAPIMessages1, cmdReminder in this case i have to set some fix reminder and fix date for every month tht automatically send by the system to some particular people... i dont knw anything abt mapi control and have never used tht... got some...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.