How to convert eml file to msg file using vc++

J

jignesh2680

Dear Experts ,

I am developing an application that need to converts eml file to msg
file using VC++ 6.0

Right now i am using redemption.dll for this conversion and it works
fine .

My problem is when Microsoft OutLook is configured with Exchange then
while converting

application ask for username / password . But it never ask for login if
the account is POP3 .

////////////////////////////////////// CODE :
/////////////////////////////////////////////////////////////////////////////////


::CoInitialize(NULL);

Redemption::ISafeMailItemPtr pMailItem("Redemption.SafeMailItem");

_ApplicationPtr pOutlook = NULL;
_NameSpacePtr pMAPI = NULL;

_MailItemPtr pM = NULL;
_MailItemPtr spMail = NULL;

pOutlook.CreateInstance("Outlook.Application");

pMAPI = pOutlook->GetNamespace("MAPI");

pMAPI->Logon("","",false ,true); // ASK for Login
if User is Exchange esle works fine.

bstr_t bstrPath("c:\\files\\1.eml");

pM = pOutlook->CreateItem(olMailItem);

pMailItem->Item = pM;

pMailItem->Import(bstrPath,1024);

bstr_t bstrMsgPath("c:\\files\\z.msg");

pMailItem->raw_SaveAs(bstrMsgPath,_variant_t((long)3)); // 3=msg

pMAPI->Logoff();

AfxMessageBox("Msg File Created");



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



This works fine when outlook is open in case of Exchange user . I mean
to say Application never ask for user login when outlook is kept open
..otherwise it ask for login .

Please help me regarding this

Thanks in Advance

Jignesh Patel

Surat
 
Joined
Mar 21, 2024
Messages
70
Reaction score
0
If you want a more comprehensive approach to importing EML files into Office 365, look at the ToolsBaer EML to Office 365 Importer. Bulk EML files can be exported to Office 365. Aside from that, you have other options to manage your EML files while performing EML to Office 365 transfer actions. You can find step-by-step instructions for successfully exporting.eml files with Office 365. I hope this article helps you discover the solution you're looking for.
 
Joined
Jul 18, 2024
Messages
11
Reaction score
0
I would like to share with you an amazing piece of software that allows you to resize EML files to Outlook msg. Windows Live Mail, SeaMonkey, Outlook Express, Thunderbird, and other EML/EMLX files can be converted to MSG format using Softaken EML to MSG Converter in one step. The folder layout, fine print, and all attachments are preserved. This EML converter is easily installed on any Windows-based operating system and generates MSG files that are compatible with Outlook 2019, 2016, 2013, and other versions.
 
Top