2 Replies Latest reply on Mar 26, 2013 8:23 PM by LarryR

    How to send the error file as a attachment

    ravi.chalich
      Hi All,

      Is it possible to send a mail by attaching the error file.
      I am writing the code in the events,if import failed then i need to send the mail with import failed error file as an attachment.

      Thanks.
        • 1. Re: How to send the error file as a attachment
          user10757003
          Yes you can do this. If it is the FDM files you plan to send then you need to understand how FDM stores the error logs etc. If you have access to the tables, have a look a the tDataArchive table (and associated tables) and in the API do a search on fArchive, (functions which can provide the necessary keys to identify the correct file)
          • 2. Re: How to send the error file as a attachment
            LarryR
            In your mail code, include something like the following prior to the .Send command. strAttach is the path to the Attachment:
            If Not strAttach="" Then' Attach file(s) to message
                 Set fso = CreateObject("Scripting.FileSystemObject")
                 If fso.FileExists(strAttach) Then .AddAttachment strAttach
                 Set fso = Nothing
            End If