Free Support Forum - aspose.com

Drag Outlook to eml

I am tring to drag and drop from outlook and save as the message as eml? Ican find sample code for msg drag and drop but not for this can you help please.

Thanks

Hello,

Please download the samples here:

http://www.aspose.com/Community/Files/54/aspose.network/entry88547.aspx

http://www.aspose.com/Community/Files/54/aspose.network/entry88543.aspx

Thanks,

Here is the tutorial

http://www.aspose.com/Wiki/default.aspx/Aspose.Network/OutlookTutorial.html

Thanks

I have completed the tutorial and looked at the demos before.

I can successfully drag and drop from outlook and save a file as msg. I can also convert files from msg to eml.

However I am trying to do save eml files directly from drag and drop rather than having to save the files twice for example converting it in memory.

Can you please let me know if this is possible.

Thank you

What do you mean by "directly from drag and drop rather than having to save the files twice for example converting it in memory"?

Could you please explain more about your issue? We will try to provide the demos.

Thanks,

We do large mail shots to subscribers and I am trying to write an app to process the bounced emails using a third part component with the users dragging and dropping the bounced emails from the inboxes on to my app.

However all the available components only accept emails in the standard eml format from a file or POP 3 account.

Therefore the plan was to use Aspose to allow people to drag and drop the files in to my app and save them as eml files which then could be processed.

I can:

1) Save the files as msg after a drag and drop using Aspose
2) load them
3) convert them
4) delete the msg files

but this seems like a lot of disk access for a process witch I was hoping to do in memory.

I have tried the following but it does not work:
Dim args As Aspose.Windows.Forms.FileDragEventArgs
args = TryCast(e, Aspose.Windows.Forms.FileDragEventArgs)
If (args IsNot Nothing) Then
If ((args.Files IsNot Nothing) AndAlso (args.Files.Count > 0)) Then
For i As Integer = 0 To args.Files.Count - 1
Dim saveDialog As New SaveFileDialog
saveDialog.FileName = args.Files(i).FileName

Dim msg As Aspose.Network.Mail.MailMessage = Nothing

Try
Dim msgFs As New System.IO.MemoryStream
args.Files(i).Save(msgFs)
msg = Aspose.Network.Mail.MailMessage.Load(msgFs, Aspose.Network.Mail.MessageFormat.Msg)
Catch ex As Exception
MessageBox.Show(“Load Failed:” & ex.Message)
End Try

If saveDialog.ShowDialog(Me) = Windows.Forms.DialogResult.Cancel Then Return
Try
Dim fs As System.IO.FileStream = New System.IO.FileStream(saveDialog.FileName, System.IO.FileMode.CreateNew)
msg.Save(fs, Aspose.Network.Mail.MessageFormat.Eml)
fs.Close()
MessageBox.Show(“Save Success.” & args.Files(i).FileName)
Catch ex As Exception
MessageBox.Show(“Save Failed:” & ex.Message)
End Try
Next
End If
End If

Thank you



Thanks for your reply.

I think we can make it. I will provide a hotfix soon.

Hello,

After saving the file to MemoryStream, we need to reset the memory stream pointer to the begin before loading it with MailMessage. Because the location of the memorystream is at the end of the content after the first time saving file to it. Let me know if it works.

For example:

Try
Dim msgFs As New System.IO.MemoryStream
args.Files(i).Save(msgFs)

//reset memorystream
msgFs.Seek(0, SeekOrigin.Begin);

msg = Aspose.Network.Mail.MailMessage.Load(msgFs, Aspose.Network.Mail.MessageFormat.Msg)
Catch ex As Exception
MessageBox.Show("Load Failed:" & ex.Message)
End Try

Thank you that worked

Do you support dragging and dropping outlook receipts as shown in the screen shot attached?

When I drag them over to my app the text of the body does not get converted.

Is this a limmitiation of the demo?

We are plnning to purchase so it doe snot matter if it is a limmitation of the demo.

Thank you

Hello,

I am a little bit confused on the "outlook receipts" you mentioned on the post. Do you mean the email item in the Outlook? We support dragging and dropping the Emails and the attachments in the email.

Thanks

If you look at the Examples.zip that is the previous post these items apear diffrent in outlook to standard emails and are sent from exchange server service.

When I drop them from outlook using Aspose they save as MSG email files however the Message body is missing.

Ok, I see. I will debug it befor get back to you.

Thanks for the reply.

Hello,

After the debugging, I found the root is not caused by the Drag & Drop control. It is the Converting from Msg to Eml file in MailMessage class.

Because the Undeliverable message is created by the Mail Server, which is different from the normal Email messages -- the Mail Server uses different way to record the error message and error code.

We need to add more parsing logic in the MailMessage class to convert these Undeliverable messages. These is a new feature in Aspose.Network, which we expect to finish it in 1 or 2 week.

Thanks

Thank you, I am on holiday for two weeks now so when I get back I will get the latest version

Hello,

We have released a new version of Aspose.Network. The empty attachment bug you mentioned has been fixed. Please check it out.

http://www.aspose.com/Community/Files/54/aspose.network/entry95314.aspx

Thanks

Does this actually work or not, I have tried it and cant seem to get it fixed.

David Walker

Job Search

Could you please give me more detail about that? I have fixed the issue you reported.