Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Outlook Converter

 AfterLogic Forum : MailBee.NET Outlook Converter
Subject Topic: To address incorrect after conversion? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 29 December 2009 at 2:22pm | IP Logged Quote hmuscroft

Hi,

I'm writing a converter to dump emails out of Outlook and import them into my own app (in .eml format).

After getting the MSG files out of outlook, here's my code :-

Code:

MailMessage msg = new MailMessage();

foreach (string msg_file in msg_files)
{
  string eml_file = Path.ChangeExtension(msg_file, ".eml");
  MailBee.OutlookMsg.MsgConvert.MsgToEml(msg_file, eml_file);

  msg.LoadMessage(eml_file);

  string to_addr = "";
  string to_name = "";

  foreach (EmailAddress add in msg.To)
  {
    to_addr += add.Email + "; ";
    to_name += add.AsString + "; ";
  }
  to_addr = to_addr.TrimEnd(new char[] { ';', ' ' });
  to_name = to_name.TrimEnd(new char[] { ';', ' ' });

  Console.WriteLine(to_addr);
  Console.WriteLine(to_name);
}

The problem is that "to_addr" is always identical to "to_name", because "To.Email" doesn't contain the email address, but rather the DisplayName.

Is this a bug in the converter? If not, then how am I supposed to get the TO email address?

The From email address works fine BTW - the problem is just with To (haven't tested CC).

Thanks.
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 29 December 2009 at 11:01pm | IP Logged Quote Igor

If you'd like us to assist you with this, please provide us with sample MSG message the issue can be reproduced with.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 29 December 2009 at 11:48pm | IP Logged Quote Igor

But prior to that, I highly recommend to make sure you're using the latest version of MailBee.NET.dll:

.NET 1.1 and above
.NET 2.0 and above

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 30 December 2009 at 2:45am | IP Logged Quote hmuscroft

As requested, I have just uploaded a sample .MSG file for you. I downloaded the latest "mailbee_net_2.zip" only a couple of days ago.

The .MSG has the following properties :-

To.Name = Hedley Muscroft [Pioneer Software]
To.Email = *****@pioneersoftware.co.uk

After converting it to EML, the EML file contains the following data :-

To.Name = Hedley Muscroft [Pioneer Software]
To.Email = Hedley Muscroft [Pioneer Software]

Look forward to your help!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 30 December 2009 at 3:37am | IP Logged Quote Igor

Thanks. However, the issue is not reproduced with the following code used:
Code:
MsgConvert.MsgToEml(@"D:\1.msg", @"D:\1.eml");
MailMessage msg = new MailMessage();
msg.LoadMessage(@"D:\1.eml");
foreach (EmailAddress adr in msg.To)
  {
  Console.WriteLine(adr.Email);
  Console.WriteLine(adr.DisplayName);
  }
Console.ReadLine();

and the output is:
Code:
*****@pioneersoftware.co.uk
Hedley Muscroft [Pioneer Software]


DLL version used is 5.8.2.186.

For privacy reasons, I have removed email username from all the posts in this thread.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 30 December 2009 at 5:33am | IP Logged Quote hmuscroft

I have copied your code and created my own test app (sent to you separately via your Helpdesk system) and I also sent you the .EML which is being created.

I am using MailBee.NET.dll version 5.8.2.186

Unfortunately the problem persists - and you can see from the EML file that the TO address is not being included.

I'm using VS2008 (SP1) on Windows 7 x64.

Look forward to your help!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 30 December 2009 at 9:56am | IP Logged Quote hmuscroft

OK, I've prepared a complete test application which clearly shows the problem and I sent the test app over to you via your helpdesk system.

To test this myself, I copied the test apps onto a different non-development PC (running Win XP x64), which means that the ONLY MailBee.NET.dll file on that computer is the one in the same folder as the test executable (which I checked is 5.8.2.186).

The program clearly demonstrates that Msg.To[x].Email always equals Msg.To[x].DisplayName in EMLs which are converted from MSG files.

Please can you have a look and get back to me on this as soon as possible?

Look forward to hearing from you shortly - thanks!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
hmuscroft
Groupie
Groupie


Joined: 29 December 2009
Location: United Kingdom
Online Status: Offline
Posts: 72
Posted: 31 December 2009 at 3:57am | IP Logged Quote hmuscroft

After further testing, it turns out that this problem is unqiue to 64 bit editions of Windows.

I've tested it on several machines and it always works fine on a 32 bit Windows machine, but fails on Windows XP x64, Vista x64 or Windows 7 x64.

Hopefully the developers can fix this as soon as possible!
Back to Top View hmuscroft's Profile Search for other posts by hmuscroft
 
marvelousmarria
Newbie
Newbie


Joined: 24 June 2011
Location: Australia
Online Status: Offline
Posts: 1
Posted: 01 July 2011 at 12:41am | IP Logged Quote marvelousmarria

Thanks guys, I have been looking for this forum.
Back to Top View marvelousmarria's Profile Search for other posts by marvelousmarria Visit marvelousmarria's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide