NetTalk Central

Author Topic: Download Attachments - What am I doing wrong  (Read 3479 times)

debraballenger

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Download Attachments - What am I doing wrong
« on: November 13, 2013, 04:31:27 PM »
Hi All,

I am sure I am doing something wrong, so any tips on what are greatly appreciated.
I am using NetEmailReceive and have the following code.  I want to save my attachments into a folder (the value for the name of the folder is contained in the variable called database).  I am not getting any attachments, and the Self.attachmentsListQ (checked in the Done (long command, long finished embed) has 0 Records.

 ThisEmailReceive.Server = 'pop.mymailserver.com'
 ThisEmailReceive.Port =110
 ThisEmailReceive.User= clip(MotorClubIntegrationEmailAddress)
 ThisEmailReceive.Password= clip(MotorClubIntegrationPassword)
 ThisEmailReceive.OptionsDelete=0
 ThisEmailReceive.OptionsDontSaveAttachments = 0
 ThisEmailReceive.OptionsDontSaveEmbeds = 0
 ThisEmailReceive.AttachmentPath = longPath()&'\'&clip(database)&'\'
 ThisEmailReceive.Decide(NET:EmailDownload)
 ThisEmailReceive.Ask(NET:EmailDownload)

Stu

  • Hero Member
  • *****
  • Posts: 509
    • View Profile
    • Email
Re: Download Attachments - What am I doing wrong
« Reply #1 on: November 13, 2013, 04:52:33 PM »
Would you use:

Code: [Select]
clip(path())&'\'&clip(database)&'\'
Longpath, in my understanding, is just for getting the actual proper path out of one of those pesky "i'm an old computer" short paths.

Also, you could assign the path earlier to a var (just in case the path changes for whatever reason). That way, if you want to change the path, you don't have to do it in this code, you can just change the var assignment.
Cheers,

Stu Andrews

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Download Attachments - What am I doing wrong
« Reply #2 on: November 14, 2013, 12:23:51 AM »
what Stu said.

The trick to debugging is to not assume anything. So examine the contents of

ThisEmailReceive.AttachmentPath

after the call to

ThisEmailReceive.AttachmentPath = longPath()&'\'&clip(database)&'\'

Cheers
Bruce

debraballenger

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: Download Attachments - What am I doing wrong
« Reply #3 on: November 14, 2013, 10:44:42 AM »
Thanks guys!