Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Aut attachment download Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Guests
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 07 June 2004 at 7:06am | IP Logged Quote Guests

Hi,

Is it anyway possible to download attachment to the server where webmail/pop3 is installed without user interaction? I am using the POP3 object to move messages from a mailserver to a local SQL database and then deleting the messages on the mailserver when moved.

Thanks for a great product.

/ Kim
Back to Top View Guests's Profile Search for other posts by Guests
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 07 June 2004 at 7:48am | IP Logged Quote Alex

Assuming you have downloaded a message and want to save its attachments to disk on the server, you can use SaveFile method of Attachment object:

...
Set Msg = Mailer.RetrieveSingleMessage(1)

For Each Attach In Msg.Attachments
Attach.SaveFile "C:\Attachments"
Next

If you want to save attachments under unique names (e.g. you store all messages attachments in the same directory) you can use FileSystemObject.GetTempName method to get unique filename:

...
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set Msg = Mailer.RetrieveSingleMessage(1)

For Each Attach In Msg.Attachments
strUnique = fso.GetTempName
Attach.SaveFile "C:\Attachments", strUnique
Next

You can obtain more information and samples in MailBee Objects documentation which is installed as a part of WebMail Pro product.
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