Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Email Attachments not saving Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
nwebster
Newbie
Newbie


Joined: 12 April 2005
Location: United States
Online Status: Offline
Posts: 9
Posted: 06 September 2005 at 8:20am | IP Logged Quote nwebster

I've noticed that when I try and pull a .msg or .eml file as an attachment from a message, it isn't saving the attachment as it does with any other type of file. Is there something special I need to set for these file types?
Back to Top View nwebster's Profile Search for other posts by nwebster
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 September 2005 at 9:30am | IP Logged Quote Alex

This is because .msg or .eml attachments often missing the filename. In your code, you should check if the filename is not empty first:

Code:

' Assume Attach is MailBee.Attachment object

If Attach.Filename = "" Then
  Attach.SaveFile "C:\Temp", "noname.eml"
Else
  Attach.SaveFile "C:\Temp"
End If


Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
nwebster
Newbie
Newbie


Joined: 12 April 2005
Location: United States
Online Status: Offline
Posts: 9
Posted: 06 September 2005 at 12:46pm | IP Logged Quote nwebster

Really? How would it not have a filename? I've always seen them with the subject as the filename. I will try that though.
Back to Top View nwebster's Profile Search for other posts by nwebster
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 September 2005 at 12:55pm | IP Logged Quote Alex

When forwarded email has no filename, Outlook uses this mail's subject + ".eml" to generate a filename.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
nwebster
Newbie
Newbie


Joined: 12 April 2005
Location: United States
Online Status: Offline
Posts: 9
Posted: 08 September 2005 at 8:05am | IP Logged Quote nwebster

I tried to check the filename, but when I changed my code from this:

oMsg.Attachments(1).SaveFile(FilePath)

to this:

If oMsg.Attachments(1).Filename = "" Then         &n bsp;         &n bsp;         &n bsp;   

oMsg.Attachments(1).SaveFile(FilePath), "noname.eml"

Else         &n bsp;         &n bsp;         &n bsp;     

oMsg.Attachments(1).SaveFile(FilePath)

End If

But it won't compule with the , "noname.eml" added on, displaying a message saying "end of statement expected". What needs to change?
Back to Top View nwebster's Profile Search for other posts by nwebster
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 08 September 2005 at 9:10am | IP Logged Quote Alex

You should replace this:

oMsg.Attachments(1).SaveFile(FilePath), "noname.eml"

with this:

oMsg.Attachments(1).SaveFile FilePath, "noname.eml"

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
nwebster
Newbie
Newbie


Joined: 12 April 2005
Location: United States
Online Status: Offline
Posts: 9
Posted: 08 September 2005 at 9:49am | IP Logged Quote nwebster

That did it, thanks!
Back to Top View nwebster's Profile Search for other posts by nwebster
 
sportsc
Newbie
Newbie


Joined: 22 December 2006
Location: Greece
Online Status: Offline
Posts: 1
Posted: 22 December 2006 at 5:07am | IP Logged Quote sportsc

Hi,

I also have the same problem.
attachment filename returns empty. the HasAttchment is true and the Count is 1.

When I ask for the Attachmnet.Content it returns the attachment's content with headers:

Content-Type:application/octet-stream;name="0219_20061221.cs v"
Content-Transfer-Encoding:base64
content-Disposition:inline;filename="0219_2001221.csv"
Content-MD5:NEMIP

How can I get the filename? And save the file? I need to save the file on disk with the name it has on the email.

Thank you
Back to Top View sportsc's Profile Search for other posts by sportsc
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 22 December 2006 at 6:31am | IP Logged Quote Andrew

We created a test message with headers you provided and got the filename of the attachment via MailBee Objects successfully.

Could you please provide us with the full message (as .eml file) which causes the issue? You can send it to support@afterlogic.com.


Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

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