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

Home Posts Topics Members FAQ

Save Mapi.Message as MSG 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 object (which represents an
email)
to my hard drive or a network 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 (converted from VB.NET)
-----------------------------------------

{
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);
// Get Inbox.
oFolder = oSession.Inbox;
// Get Messages collection.
oMessages = oFolder.Message s;
// Get the second email
oMessage = oMessages.Item( 2);
}
-------------------------------------------
Your help will be greatly appreciated
Jun 27 '08 #1
3 3609

Hi Nabil, there is not reason to use Redemption (unless your customers
hates the Outlook security msgboxes ;-))

This code did the trick in my outlook add-in

dim objMailItem as Outlook.mailite m
objMailItem.Sav eAs (FileName)

You should have a look at http://www.outlookcode.com/

Best regards

Kasper
I'm trying to save an MApi.Message object (which represents an
email)
to my hard drive or a network 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)
Jun 27 '08 #2
Thanks kasper. This code is to run on a server which doesn't have
Outlook installed. instead I only have Microsoft Messaging API and
Collaboration Data Objects on there!

More specifically, it will run as a Windows Service (Previously NT
Service) so any security message will cause an error anyway!

Thanks for your help anyway!
Jun 27 '08 #3
thd
On Mon, 21 Apr 2008 06:06:22 -0700, Nabil wrote:
Thanks kasper. This code is to run on a server which doesn't have
Outlook installed. instead I only have Microsoft Messaging API and
Collaboration Data Objects on there!

More specifically, it will run as a Windows Service (Previously NT
Service) so any security message will cause an error anyway!

Thanks for your help anyway!
AFAIK, you can only get .MSG files using Outlook, or Redemption.

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
3420
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
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,...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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...
1
3051
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
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.