Search The ForumSearch   RegisterRegister  LoginLogin

MailBee Objects

 AfterLogic Forum : MailBee Objects
Subject Topic: .EML and .MSG Attachments Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jmckinney
Newbie
Newbie


Joined: 09 June 2007
Location: United States
Online Status: Offline
Posts: 2
Posted: 09 June 2007 at 10:33am | IP Logged Quote jmckinney

Hello,

We have an issue with forwarding emails from outlook where an email is attached with the .EML extension and sent with the forwarded message. When trying to save the attachments for these objects, there seems to be no valid filename created with the Attachments functions. Does mail be do any kind of stripping of .EML or .MSG messages or is there a better way to handle these as attachments?

Thanks

John
Back to Top View jmckinney's Profile Search for other posts by jmckinney
 
jmckinney
Newbie
Newbie


Joined: 09 June 2007
Location: United States
Online Status: Offline
Posts: 2
Posted: 09 June 2007 at 11:38am | IP Logged Quote jmckinney

Here is some sample code that I am using to load one of the messages.

It outputs the filenames at the end, which read as normal for regular attachments, and blank for .MSG attachments, appearing that the attachment filename is dropped:

Response.Write("<br>" + CStr(i) + "<br>strFromName=" + Server.HTMLEncode(Msg.FromAddr) + " Name :" + Msg.FromFriendlyName)
Response.Write("<br>toAddress=" + Server.HTMLEncode(Msg.ToAddr))
Response.Write("<br>Subject=" + Msg.Subject + "<hr>")
                      If Msg.BodyFormat = 1 Then
                           ' Display HTML-formatted message directly
                           Response.Write Msg.BodyText
                      Else
                           ' For non-HTML messages, we need to prepare the message
                           ' for viewing in the browser
                           Response.Write "<pre>"
                           Response.Write Server.HTMLEncode(Msg.BodyText)
                           Response.Write "</pre>"
                      End If
           'Response.Write("<br>Mailer.BodyText=" + Msg.BodyText)
           Response.Write("<hr><br><br>Attachment Count: " & Msg.Attachments.Count)
                            If Msg.Attachments.Count > 0 Then         &n bsp;     
                                      For j = 1 To Msg.Attachments.Count      &nb sp;         &nb sp;         &nb sp;         &nb sp;         &nb sp;        
                                            Response.Write ("<br>Attachment #" & j & ": " & Msg.Attachments(j).Filename)
                                      Next
                            End If
                
Back to Top View jmckinney's Profile Search for other posts by jmckinney
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 10 June 2007 at 7:58am | IP Logged Quote Alex

Yes, that's correct. If you open such .EML file in a text viewer, you'll see there is indeed no name.

You should invent your own filename in this situation (like Outlook does). For instance:
Code:

k = 1
For j = 1 To Msg.Attachments.Count
  If Msg.Attachment[j].Filename = "" Then
    filename = "att_" & k & ".att"
    k = k + 1
  Else
    filename = Msg.Attachment[j].Filename
  End If
Next


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

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