It is currently Sun May 19, 2019 9:37 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: PB.Ex Mail (Windows)
PostPosted: Mon Apr 29, 2019 10:02 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
Hello

With this library you can develop your own e-mail client and download e-mails via IMAP and POP3. SSL and TLS are supported.

Functions:
  • OpenMailEx()
    • Syntax:
      Code:
      Result = OpenMailEx(ID, Protocol, MailServer$, Port, UserName$, Password$, SSL, @ErrorOutput$)

    • Description: Establishes a connection to the mail server.
    • Parameter:
      1. ID: A unique number. #PB_Any can be used to generate the number automatically.
      2. Protocol: One of the following protocols can be used:
        • #PBEx_Mail_Protocol_IMAP
        • #PBEx_Mail_Protocol_POP3: Note: Please use this protocol for testing purposes only. This protocol is obsolete and will not be further developed.
      3. MailServer$: The address to the mail server
      4. Port: Port number
      5. UserName$: Username or email address for login.
      6. Password$: Password for login.
      7. SSL: If 1, then an encrypted connection is established.
      8. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful. If #PB_Any is used, the ID is returned.
    • Example:
      Code:
      #PBEx_Mail_Version$ = "1.0.8.0"

      EnableExplicit

      Global PBEx_Mail

      #PBEx_Mail_Version$ = "1.0.8.0"
      #PBEx_Mail_Protocol_IMAP = 0
      #PBEx_Mail_Protocol_POP3 = 1
      #PBEx_Mail_Priority_Normal = 0
      #PBEx_Mail_Priority_Low = 1
      #PBEx_Mail_Priority_High = 2
      #PBEx_Mail_Event_NewMail = 0
      #PBEx_Mail_Attribute_Unseen = 0
      #PBEx_Mail_Attribute_Seen = 32
      #PBEx_Mail_SeenType_AllMails = 0
      #PBEx_Mail_SeenType_OnlySeenMails = 1
      #PBEx_Mail_SeenType_OnlyUnseenMails = 2
      #PBEx_Mail_FetchType_AllData = 0
      #PBEx_Mail_FetchType_OnlyHeaderData = 1

      CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
        PBEx_Mail = OpenLibrary(#PB_Any, "PB.Ex_Mail_x86.dll")
      CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
        PBEx_Mail = OpenLibrary(#PB_Any, "PB.Ex_Mail_x64.dll")
      CompilerEndIf

      If PBEx_Mail
        Prototype OpenMailEx(ID, Protocol, MailServer.p-Unicode, Port, UserName.p-Unicode, Password.p-Unicode, SSL, ErrorOutput)
        Global OpenMailEx.OpenMailEx = GetFunction(PBEx_Mail, "OpenMailEx")
        Prototype CloseMailEx(ID, ErrorOutput)
        Global CloseMailEx.CloseMailEx = GetFunction(PBEx_Mail, "CloseMailEx")
        Prototype ExamineMailDirectoryEx(ID, ErrorOutput)
        Global ExamineMailDirectoryEx.ExamineMailDirectoryEx = GetFunction(PBEx_Mail, "ExamineMailDirectoryEx")
        Prototype MailDirectoryEntryNameEx(ID, Output, ErrorOutput)
        Global MailDirectoryEntryNameEx.MailDirectoryEntryNameEx = GetFunction(PBEx_Mail, "MailDirectoryEntryNameEx")
        Prototype ExamineMailEx(ID, SeenType, FetchType, SortByNew, ErrorOutput)
        Global ExamineMailEx.ExamineMailEx = GetFunction(PBEx_Mail, "ExamineMailEx")
        Prototype MailEntrySubjectEx(ID, Output, ErrorOutput)
        Global MailEntrySubjectEx.MailEntrySubjectEx = GetFunction(PBEx_Mail, "MailEntrySubjectEx")
        Prototype MailEntryBodyEx(ID, Output, ErrorOutput)
        Global MailEntryBodyEx.MailEntryBodyEx = GetFunction(PBEx_Mail, "MailEntryBodyEx")
        Prototype MailEntryFromEx(ID, Output, ErrorOutput)
        Global MailEntryFromEx.MailEntryFromEx = GetFunction(PBEx_Mail, "MailEntryFromEx")
        Prototype MailEntryToEx(ID, Output, ErrorOutput)
        Global MailEntryToEx.MailEntryToEx = GetFunction(PBEx_Mail, "MailEntryToEx")
        Prototype MailEntryCCEx(ID, Output, ErrorOutput)
        Global MailEntryCCEx.MailEntryCCEx = GetFunction(PBEx_Mail, "MailEntryCCEx")
        Prototype MailEntryBCCEx(ID, Output, ErrorOutput)
        Global MailEntryBCCEx.MailEntryBCCEx = GetFunction(PBEx_Mail, "MailEntryBCCEx")
        Prototype MailEntryDateEx(ID, ErrorOutput)
        Global MailEntryDateEx.MailEntryDateEx = GetFunction(PBEx_Mail, "MailEntryDateEx")
        Prototype MailEntryPriorityEx(ID, ErrorOutput)
        Global MailEntryPriorityEx.MailEntryPriorityEx = GetFunction(PBEx_Mail, "MailEntryPriorityEx")
        Prototype FinishMailDirectoryEx(ID, ErrorOutput)
        Global FinishMailDirectoryEx.FinishMailDirectoryEx = GetFunction(PBEx_Mail, "FinishMailDirectoryEx")
        Prototype FinishMailEx(ID, ErrorOutput)
        Global FinishMailEx.FinishMailEx = GetFunction(PBEx_Mail, "FinishMailEx")
        Prototype IsMailEx(ID, ErrorOutput)
        Global IsMailEx.IsMailEx = GetFunction(PBEx_Mail, "IsMailEx")
        Prototype NextMailDirectoryEntryEx(ID, ErrorOutput)
        Global NextMailDirectoryEntryEx.NextMailDirectoryEntryEx = GetFunction(PBEx_Mail, "NextMailDirectoryEntryEx")
        Prototype NextMailEntryEx(ID, ErrorOutput)
        Global NextMailEntryEx.NextMailEntryEx = GetFunction(PBEx_Mail, "NextMailEntryEx")
        Prototype SetMailDirectoryEx(ID, DirectoryPath.p-Unicode, ErrorOutput)
        Global SetMailDirectoryEx.SetMailDirectoryEx = GetFunction(PBEx_Mail, "SetMailDirectoryEx")
        Prototype CreateMailDirectoryEx(ID, DirectoryName.p-Unicode, ErrorOutput)
        Global CreateMailDirectoryEx.CreateMailDirectoryEx = GetFunction(PBEx_Mail, "CreateMailDirectoryEx")
        Prototype RenameMailDirectoryEx(ID, OldDirectoryName.p-Unicode, NewDirectoryName.p-Unicode, ErrorOutput)
        Global RenameMailDirectoryEx.RenameMailDirectoryEx = GetFunction(PBEx_Mail, "RenameMailDirectoryEx")
        Prototype DeleteMailDirectoryEx(ID, DirectoryPath.p-Unicode, ErrorOutput)
        Global DeleteMailDirectoryEx.DeleteMailDirectoryEx = GetFunction(PBEx_Mail, "DeleteMailDirectoryEx")
        Prototype CreateMailEx(ID, Directory.p-Unicode, Subject.p-Unicode, Body.p-Unicode, Priority, From.p-Unicode, ToAddress.p-Unicode, CC.p-Unicode, BCC.p-Unicode, Attachments.p-Unicode, ErrorOutput)
        Global CreateMailEx.CreateMailEx = GetFunction(PBEx_Mail, "CreateMailEx")
        Prototype BindMailEventEx(ID, Event, PBProcedureHandle, PID, ErrorOutput)
        Global BindMailEventEx.BindMailEventEx = GetFunction(PBEx_Mail, "BindMailEventEx")
        Prototype GetMailSubjectEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailSubjectEx.GetMailSubjectEx = GetFunction(PBEx_Mail, "GetMailSubjectEx")
        Prototype GetMailBodyEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailBodyEx.GetMailBodyEx = GetFunction(PBEx_Mail, "GetMailBodyEx")
        Prototype GetMailFromEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailFromEx.GetMailFromEx = GetFunction(PBEx_Mail, "GetMailFromEx")
        Prototype GetMailToEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailToEx.GetMailToEx = GetFunction(PBEx_Mail, "GetMailToEx")
        Prototype GetMailCCEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailCCEx.GetMailCCEx = GetFunction(PBEx_Mail, "GetMailCCEx")
        Prototype GetMailBCCEx(ID, MailID, DirectoryPath.p-Unicode, Output, ErrorOutput)
        Global GetMailBCCEx.GetMailBCCEx = GetFunction(PBEx_Mail, "GetMailBCCEx")
        Prototype GetMailDateEx(ID, MailID, DirectoryPath.p-Unicode, ErrorOutput)
        Global GetMailDateEx.GetMailDateEx = GetFunction(PBEx_Mail, "GetMailDateEx")
        Prototype GetMailPriorityEx(ID, MailID, DirectoryPath.p-Unicode, ErrorOutput)
        Global GetMailPriorityEx.GetMailPriorityEx = GetFunction(PBEx_Mail, "GetMailPriorityEx")
        Prototype MailEntryBodySizeEx(ID, ErrorOutput)
        Global MailEntryBodySizeEx.MailEntryBodySizeEx = GetFunction(PBEx_Mail, "MailEntryBodySizeEx")
        Prototype MailIDEx(ID, ErrorOutput)
        Global MailIDEx.MailIDEx = GetFunction(PBEx_Mail, "MailIDEx")
        Prototype SetMailSubjectEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailSubjectEx.SetMailSubjectEx = GetFunction(PBEx_Mail, "SetMailSubjectEx")
        Prototype SetMailBodyEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailBodyEx.SetMailBodyEx = GetFunction(PBEx_Mail, "SetMailBodyEx")
        Prototype SetMailFromEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailFromEx.SetMailFromEx = GetFunction(PBEx_Mail, "SetMailFromEx")
        Prototype SetMailToEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailToEx.SetMailToEx = GetFunction(PBEx_Mail, "SetMailToEx")
        Prototype SetMailCCEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailCCEx.SetMailCCEx = GetFunction(PBEx_Mail, "SetMailCCEx")
        Prototype SetMailBCCEx(ID, MailID, Directory.p-Unicode, Text.p-Unicode, ErrorOutput)
        Global SetMailBCCEx.SetMailBCCEx = GetFunction(PBEx_Mail, "SetMailBCCEx")
        Prototype SetMailPriorityEx(ID, MailID, Directory.p-Unicode, Priority, ErrorOutput)
        Global SetMailPriorityEx.SetMailPriorityEx = GetFunction(PBEx_Mail, "SetMailPriorityEx")
        Prototype DeleteMailEx(ID, MailID, Directory.p-Unicode, ErrorOutput)
        Global DeleteMailEx.DeleteMailEx = GetFunction(PBEx_Mail, "DeleteMailEx")
        Prototype MoveMailEx(ID, MailID, Directory.p-Unicode, TargetDirectory.p-Unicode, ErrorOutput)
        Global MoveMailEx.MoveMailEx = GetFunction(PBEx_Mail, "MoveMailEx")
        Prototype CountMailEx(ID, Directory.p-Unicode, ErrorOutput)
        Global CountMailEx.CountMailEx = GetFunction(PBEx_Mail, "CountMailEx")
        Prototype CountMailDirectoryEx(ID, ErrorOutput)
        Global CountMailDirectoryEx.CountMailDirectoryEx = GetFunction(PBEx_Mail, "CountMailDirectoryEx")
        Prototype SendMailEx(ID, MailServer.p-Unicode, Port, UserName.p-Unicode, Password.p-Unicode, SSL, Subject.p-Unicode, Body.p-Unicode, Priority, From.p-Unicode, ToAddress.p-Unicode, CC.p-Unicode, BCC.p-Unicode, Attachments.p-Unicode, ErrorOutput)
        Global SendMailEx.SendMailEx = GetFunction(PBEx_Mail, "SendMailEx")
        Prototype SaveMailEx(ID, MailID, Directory.p-Unicode, Path.p-Unicode, ErrorOutput)
        Global SaveMailEx.SaveMailEx = GetFunction(PBEx_Mail, "SaveMailEx")
        Prototype GetMailHeaderEx(ID, MailID, Directory.p-Unicode, Output, ErrorOutput)
        Global GetMailHeaderEx.GetMailHeaderEx = GetFunction(PBEx_Mail, "GetMailHeaderEx")
        Prototype MailEntryHeaderEx(ID, Output, ErrorOutput)
        Global MailEntryHeaderEx.MailEntryHeaderEx = GetFunction(PBEx_Mail, "MailEntryHeaderEx")
        Prototype LoadMailEx(ID, Path.p-Unicode, Directory.p-Unicode, ErrorOutput)
        Global LoadMailEx.LoadMailEx = GetFunction(PBEx_Mail, "LoadMailEx")
        Prototype SendMailFileEx(ID, MailServer.p-Unicode, Port, UserName.p-Unicode, Password.p-Unicode, SSL, Path.p-Unicode, ErrorOutput)
        Global SendMailFileEx.SendMailFileEx = GetFunction(PBEx_Mail, "SendMailFileEx")
        Prototype CountMailAttachmentsEx(ID, ErrorOutput)
        Global CountMailAttachmentsEx.CountMailAttachmentsEx = GetFunction(PBEx_Mail, "CountMailAttachmentsEx")
        Prototype ExamineMailAttachmentsEx(ID, ErrorOutput)
        Global ExamineMailAttachmentsEx.ExamineMailAttachmentsEx = GetFunction(PBEx_Mail, "ExamineMailAttachmentsEx")
        Prototype NextMailEntryAttachmentsEx(ID, ErrorOutput)
        Global NextMailEntryAttachmentsEx.NextMailEntryAttachmentsEx = GetFunction(PBEx_Mail, "NextMailEntryAttachmentsEx")
        Prototype MailEntryAttachmentsFileNameEx(ID, Output, ErrorOutput)
        Global MailEntryAttachmentsFileNameEx.MailEntryAttachmentsFileNameEx = GetFunction(PBEx_Mail, "MailEntryAttachmentsFileNameEx")
        Prototype SaveMailEntryAttachmentsEx(ID, Path.p-Unicode, ErrorOutput)
        Global SaveMailEntryAttachmentsEx.SaveMailEntryAttachmentsEx = GetFunction(PBEx_Mail, "SaveMailEntryAttachmentsEx")
        Prototype FinishMailAttachmentsEx(ID, ErrorOutput)
        Global FinishMailAttachmentsEx.FinishMailAttachmentsEx = GetFunction(PBEx_Mail, "FinishMailAttachmentsEx")
        Prototype GetMailAttachmentsEx(ID, MailID, Directory.p-Unicode, ErrorOutput)
        Global GetMailAttachmentsEx.GetMailAttachmentsEx = GetFunction(PBEx_Mail, "GetMailAttachmentsEx")
        Prototype SetMailAttachmentsEx(ID, MailID, Directory.p-Unicode, Attachments.p-Unicode, ErrorOutput)
        Global SetMailAttachmentsEx.SetMailAttachmentsEx = GetFunction(PBEx_Mail, "SetMailAttachmentsEx")
        Prototype MailEntryAttributeEx(ID, ErrorOutput)
        Global MailEntryAttributeEx.MailEntryAttributeEx = GetFunction(PBEx_Mail, "MailEntryAttributeEx")
        Prototype SetMailAttributeEx(ID, MailID, Directory.p-Unicode, Attributes, ErrorOutput)
        Global SetMailAttributeEx.SetMailAttributeEx = GetFunction(PBEx_Mail, "SetMailAttributeEx")
        Prototype GetMailAttributeEx(ID, MailID, Directory.p-Unicode, ErrorOutput)
        Global GetMailAttributeEx.GetMailAttributeEx = GetFunction(PBEx_Mail, "GetMailAttributeEx")
       
      EndIf

      Global Output$ = Space(1000000)
      Global ErrorOutput$ = Space(128)

      Procedure NewMail(MailID$)
        Protected MailID = Val(MailID$)
       
        GetMailSubjectEx(1, MailID, "", @Output$, @ErrorOutput$)
        Debug "Subject: " + Output$
        GetMailFromEx(1, MailID, "", @Output$, @ErrorOutput$)
        Debug "From: " + Output$
        GetMailToEx(1, MailID, "", @Output$, @ErrorOutput$)
        Debug "To: " + Output$
        Debug "Date: " + FormatDate("%dd.%mm.%yyyy %hh:%ii:%ss", GetMailDateEx(1, MailID, "", @ErrorOutput$))
       
      EndProcedure

      If OpenMailEx(1, #PBEx_Mail_Protocol_IMAP, "imap.gmail.com", 993, "yourmailaddress@gmail.com", "YourPassword", 1, @ErrorOutput$)
       
      ;  ;Notify automatically when new emails arrive.
      ;   If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
      ;     
      ;     BindMailEventEx(1, #PBEx_Mail_Event_NewMail, @NewMail(), GetCurrentProcessId_(), @ErrorOutput$)
      ;     
      ;     Repeat
      ;       Select WaitWindowEvent()
      ;         Case #PB_Event_CloseWindow
      ;           End
      ;       EndSelect
      ;     ForEver
      ;   EndIf
       
      ;   ;Determine all directories (only for IMAP)
      ;   If ExamineMailDirectoryEx(1, @ErrorOutput$)
      ;     While NextMailDirectoryEntryEx(1, @ErrorOutput$)
      ;       MailDirectoryEntryNameEx(1, @Output$, @ErrorOutput$)
      ;       Debug Output$
      ;     Wend
      ;   
      ;   EndIf
       
        ;Determine all mail from inbox
        ;Or from any directory
        ;SetMailDirectoryEx(1, "Downloadportale/Chip", @ErrorOutput$)
        If ExamineMailEx(1, #PBEx_Mail_SeenType_AllMails, #PBEx_Mail_FetchType_AllData, 0, @ErrorOutput$)
          While NextMailEntryEx(1, @ErrorOutput$)
            MailEntrySubjectEx(1, @Output$, @ErrorOutput$)
            Debug "Subject: " + Output$
            MailEntryFromEx(1, @Output$, @ErrorOutput$)
            Debug "From: " + Output$
            MailEntryToEx(1, @Output$, @ErrorOutput$)
            Debug "To: " + Output$
            Debug "Date: " + FormatDate("%dd.%mm.%yyyy %hh:%ii:%ss", MailEntryDateEx(1, @ErrorOutput$))
             Debug MailIDEx(1, @ErrorOutput$)
            Debug Str(CountMailAttachmentsEx(1, @ErrorOutput$)) + " attachment(s)"
           
            If ExamineMailAttachmentsEx(1, @ErrorOutput$)
              While NextMailEntryAttachmentsEx(1, @ErrorOutput$)
                If MailEntryAttachmentsFileNameEx(1, @Output$, @ErrorOutput$)
                  Debug Output$
                EndIf
              Wend
            EndIf
           
            Debug "--------------------------------------------------"
          Wend
         
        EndIf
       
        CloseMailEx(1, @ErrorOutput$)
      Else
        Debug ErrorOutput$
      EndIf

      CloseLibrary(PBEx_Mail)

  • CloseMailEx()
    • Syntax:
      Code:
      Result = CloseMailEx(ID, @ErrorOutput$)

    • Description: Closes the connection to the mail server.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • ExamineMailDirectoryEx()
    • Syntax:
      Code:
      Result = ExamineMailDirectoryEx(ID, @ErrorOutput$)

    • Description: Starts the listing from the directory structure. POP3 does not support directories.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailDirectoryEntryNameEx()
    • Syntax:
      Code:
      Result = MailDirectoryEntryNameEx(ID, @Output, @ErrorOutput$)

    • Description: The name of the directory is determined. This function is only valid within the ExamineMailDirectoryEx loop. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: The name of the directory is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • ExamineMailEx()
    • Syntax:
      Code:
      Result = ExamineMailEx(ID, SeenType, FetchType, SortByNew, @ErrorOutput$)

    • Description: Starts the collection from the current directory.
    • Parameter:
      1. ID: The number of the connection.
      2. SeenType: Determines whether all e-mails or only e-mails that have already been read or have not yet been read are determined. This function is not supported with POP3. The following constants can be used:
        • #PBEx_Mail_SeenType_AllMails
        • #PBEx_Mail_SeenType_OnlySeenMails
        • #PBEx_Mail_SeenType_OnlyUnseenMails
      3. FetchType: Determines whether all data or only the header data of the e-mails is downloaded. This function is not supported with POP3. The following constants can be used:
        • #PBEx_Mail_FetchType_AllData
        • #PBEx_Mail_FetchType_OnlyHeaderData
      4. SortByNew: Defines the order in which e-mails are determined:
        • 0: The emails that were created first are determined first.
        • 1: The newest e-mails are determined first.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntrySubjectEx()
    • Syntax:
      Code:
      Result = MailEntrySubjectEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the subject of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: Subject of the email is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryBodyEx()
    • Syntax:
      Code:
      Result = MailEntryBodyEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the content of the e-mail. It can be either plain text or HTML. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: The content of the e-mail is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryFromEx()
    • Syntax:
      Code:
      Result = MailEntryFromEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the sender of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: The sender of the e-mail is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryToEx()
    • Syntax:
      Code:
      Result = MailEntryToEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the recipient of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: The recipient of the e-mail is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryCCEx()
    • Syntax:
      Code:
      Result = MailEntryCCEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the CC recipient (visible recipient) of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: CC recipient of the e-mail is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryBCCEx()
    • Syntax:
      Code:
      Result = MailEntryBCCEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the BCC recipient (invisible recipient) of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: BCC recipient of the e-mail is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryDateEx()
    • Syntax:
      Code:
      Result = MailEntryDateEx(ID, @ErrorOutput$)

    • Description: Determines the date of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The date of the e-mail. The value can be used with the date library.
  • MailEntryPriorityEx()
    • Syntax:
      Code:
      Result = MailEntryPriorityEx(ID, @ErrorOutput$)

    • Description: Determines the specified priority of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The priority of the e-mail. The following constants can be queried:
      • #PBEx_Mail_Priority_Normal
      • #PBEx_Mail_Priority_Low
      • #PBEx_Mail_Priority_High
  • FinishMailDirectoryEx()
    • Syntax:
      Code:
      Result = FinishMailDirectoryEx(ID, @ErrorOutput$)

    • Description: Closes the listing of the directory structure.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • FinishMailEx()
    • Syntax:
      Code:
      Result = FinishMailEx(ID, @ErrorOutput$)

    • Description: Closes the list of the current directory.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • IsMailEx()
    • Syntax:
      Code:
      Result = IsMailEx(ID, @ErrorOutput$)

    • Description: Checks if the connection is still valid.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: ID ist gültig.
  • NextMailDirectoryEntryEx()
    • Syntax:
      Code:
      Result = NextMailDirectoryEntryEx(ID, @ErrorOutput$)

    • Description: The next directory is determined. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • NextMailEntryEx()
    • Syntax:
      Code:
      Result = NextMailEntryEx(ID, @ErrorOutput$)

    • Description: The next e-mail will be determined.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailDirectoryEx()
    • Syntax:
      Code:
      Result = SetMailDirectoryEx(ID, DirectoryPath$, @ErrorOutput$)

    • Description: Opens the directory to find the emails in this directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. DirectoryPath$: Name or full path of the directory. If empty, the inbox directory is selected.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • CreateMailDirectoryEx()
    • Syntax:
      Code:
      Result = CreateMailDirectoryEx(ID, DirectoryName$, @ErrorOutput$)

    • Description: Creates a new directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. DirectoryName$: Name of the directory.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • RenameMailDirectoryEx()
    • Syntax:
      Code:
      Result = RenameMailDirectoryEx(ID, OldDirectoryName$, NewDirectoryName$, @ErrorOutput$)

    • Description: Renames an existing directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. OldDirectoryName$: Name of the directory.
      3. NewDirectoryName$: New name for the directory.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • DeleteMailDirectoryEx()
    • Syntax:
      Code:
      Result = DeleteMailDirectoryEx(ID, DirectoryName$, @ErrorOutput$)

    • Description: Removes an existing directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. DirectoryName$: Name of the directory.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • CreateMailEx()
    • Syntax:
      Code:
      Result = CreateMailEx(ID, Directory$, Subject$, Body$, Priority, From$, ToAddress$, CC$, BCC$, Attachments$, @ErrorOutput$)

    • Description: Creates a new email that is not sent.
    • Parameter:
      1. ID: The number of the connection.
      2. Directory$: Name of the directory
      3. Subject$: E-mail subject
      4. Body$: Contents of the e-mail
      5. Priority: Determination of the priority. One of the following constants can be used:
        • #PBEx_Mail_Priority_Normal
        • #PBEx_Mail_Priority_Low
        • #PBEx_Mail_Priority_High
      6. From$: E-mail address of the sender.
      7. ToAddress$: E-mail address of the recipient. Multiple email addresses can be separated with semicolons.
      8. CC$: E-mail address of the recipient (visible recipient). Multiple email addresses can be separated with semicolons.
      9. BCC$: E-mail address of the recipient (invisible recipient). Multiple email addresses can be separated with semicolons.
      10. Attachments$: Full path to the file to be added as an attachment. Multiple attachments can be separated with the | character.
      11. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • BindMailEventEx()
    • Syntax:
      Code:
      Result = BindMailEventEx(ID, Event, @PBProcedure(), PID, @ErrorOutput$)

    • Description: Link a procedure to an event.
    • Parameter:
      1. ID: The number of the connection.
      2. Event: Specifies the event to be queried. One of the following constants can be used:
        • #PBEx_Mail_Event_NewMail: The event is triggered as soon as new e-mails are available.
      3. @PBProcedure(): The handle number of the procedure that is automatically called when the specified event is triggered.
      4. PID: The PID number of your own program.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailSubjectEx()
    • Syntax:
      Code:
      Result = GetMailSubjectEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the subject using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The subject is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailBodyEx()
    • Syntax:
      Code:
      Result = GetMailBodyEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the content using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The content is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailFromEx()
    • Syntax:
      Code:
      Result = GetMailFromEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the sender using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The sender is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailToEx()
    • Syntax:
      Code:
      Result = GetMailToEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the recipient using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The receiver is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailCCEx()
    • Syntax:
      Code:
      Result = GetMailCCEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the CC recipient using the MailID. (visible recipient)
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The CC receiver is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailBCCEx()
    • Syntax:
      Code:
      Result = GetMailBCCEx(ID, MailID, DirectoryPath$, @Output$, @ErrorOutput$)

    • Description: Determines the BCC recipient using the MailID. (invisible recipient)
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The BCC receiver is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailDateEx()
    • Syntax:
      Code:
      Result = GetMailDateEx(ID, MailID, DirectoryPath$, @ErrorOutput$)

    • Description: Determines the date using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The date of the e-mail. The value can be used with the date library.
  • GetMailPriorityEx()
    • Syntax:
      Code:
      Result = GetMailPriorityEx(ID, MailID, DirectoryPath$, @ErrorOutput$)

    • Description: Determines the priority using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The priority of the e-mail. The following constants can be queried:
      • #PBEx_Mail_Priority_Normal
      • #PBEx_Mail_Priority_Low
      • #PBEx_Mail_Priority_High
  • MailEntryBodySizeEx()
    • Syntax:
      Code:
      Result = MailEntryBodySizeEx(ID, @ErrorOutput$)

    • Description: Determines the size in bytes for allocating memory.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: Size in bytes
  • MailIDEx()
    • Syntax:
      Code:
      Result = MailIDEx(ID, @ErrorOutput$)

    • Description: Determines the mail ID for reading or changing properties. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: ID of the e-mail
  • SetMailSubjectEx()
    • Syntax:
      Code:
      Result = SetMailSubjectEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the subject using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailBodyEx()
    • Syntax:
      Code:
      Result = SetMailBodyEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the content using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailFromEx()
    • Syntax:
      Code:
      Result = SetMailFromEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the sender using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailToEx()
    • Syntax:
      Code:
      Result = SetMailToEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the recipient using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value. Multiple email addresses can be separated with semicolons.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailCCEx()
    • Syntax:
      Code:
      Result = SetMailCCEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the CC recipient (visible recipient) using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value. Multiple email addresses can be separated with semicolons.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailBCCEx()
    • Syntax:
      Code:
      Result = SetMailBCCEx(ID, MailID, Directory$, Text$, @ErrorOutput$)

    • Description: Changes the BCC recipient (invisible recipient) using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Text$: Changes with the specified value. Multiple email addresses can be separated with semicolons.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailPriorityEx()
    • Syntax:
      Code:
      Result = SetMailPriorityEx(ID, MailID, Directory$, Priority, @ErrorOutput$)

    • Description: Changes the priority using the mail ID. Due to the specification that the e-mail must not be modified subsequently, the changed e-mail is saved as a new e-mail. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name of the directory
      4. Priority: Priority of the e-mail. One of the following constants can be used:
        • #PBEx_Mail_Priority_Normal
        • #PBEx_Mail_Priority_Low
        • #PBEx_Mail_Priority_High
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • DeleteMailEx()
    • Syntax:
      Code:
      Result = DeleteMailEx(ID, MailID, Directory$, @ErrorOutput$)

    • Description: Removes the e-mail using the mail ID and directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name or full path to the directory where the specified e-mail is located. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MoveMailEx()
    • Syntax:
      Code:
      Result = MoveMailEx(ID, MailID, Directory$, TargetDirectory$, @ErrorOutput$)

    • Description: Moves the e-mail to the specified target directory using the mail ID and the source directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: ID of the e-mail
      3. Directory$: Name or full path to the directory where the specified e-mail is located. If empty, the inbox directory is selected.
      4. TargetDirectory$: Name or full path to the directory to which the e-mail is to be moved. If empty, the inbox directory is selected.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • CountMailEx()
    • Syntax:
      Code:
      Result = CountMailEx(ID, Directory$, @ErrorOutput$)

    • Description: Determines how many e-mails exist in the specified directory.
    • Parameter:
      1. ID: The number of the connection.
      2. Directory$: Name or full path to the directory. If empty, the inbox directory is selected.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: Number of e-mails.
  • CountMailDirectoryEx()
    • Syntax:
      Code:
      Result = CountMailDirectoryEx(ID, @ErrorOutput$)

    • Description: Determines how many directories exist. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: Number of directories.
  • SendMailEx()
    • Syntax:
      Code:
      Result = SendMailEx(ID, MailServer$, Port, UserName, Password$, SSL, Subject$, Body$, Priority, From$, ToAddress$, CC$, BCC$, Attachments$, @ErrorOutput$)

    • Description: Sends a new e-mail.
    • Parameter:
      1. ID: The number of the connection.
      2. MailServer$: The address to the mail server
      3. Port: port number
      4. UserName$: Username or email address for login.
      5. Password$: Password for login.
      6. SSL: If 1, then an encrypted connection is established.
      7. Subject$: E-mail subject
      8. Body$: Contents of the e-mail
      9. Priority: Determination of the priority. One of the following constants can be used:
        • #PBEx_Mail_Priority_Normal
        • #PBEx_Mail_Priority_Low
        • #PBEx_Mail_Priority_High
      10. From$: E-mail address of the sender.
      11. ToAddress$: E-mail address of the recipient. Multiple email addresses can be separated with semicolons.
      12. CC$: E-mail address of the recipient (visible recipient). Multiple email addresses can be separated with semicolons.
      13. BCC$: E-mail address of the recipient (invisible recipient). Multiple email addresses can be separated with semicolons.
      14. Attachments$: Full path to the file to be added as an attachment. Multiple attachments can be separated with the | character.
      15. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SaveMailEx()
    • Syntax:
      Code:
      Result = SaveMailEx(ID, MailID, Directory$, Path$, @ErrorOutput$)

    • Description: Saves an existing e-mail as an EML file on the hard disk.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. Path$: Complete path incl. file name where the e-mail should be exported to.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailHeaderEx()
    • Syntax:
      Code:
      Result = GetMailHeaderEx(ID, MailID, Directory$, @Output$, @ErrorOutput$)

    • Description: Determines the complete header of the e-mail using the MailID.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of a single e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @Output$: The header is stored in this variable.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryHeaderEx()
    • Syntax:
      Code:
      Result = MailEntryHeaderEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the header of the e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output$: The header is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • LoadMailEx()
    • Syntax:
      Code:
      Result = LoadMailEx(ID, Path$, Directory$, @ErrorOutput$)

    • Description: Imports an EML file into the specified directory. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. Path$: Full path to the EML file.
      3. Directory$: Name or full path to the directory. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: MailID of the imported e-mail.
  • SendMailFileEx()
    • Syntax:
      Code:
      Result = SendMailFileEx(ID, MailServer$, Port, UserName, Password$, SSL, Path$, @ErrorOutput$)

    • Description: Sends an e-mail using an EML file.
    • Parameter:
      1. ID: The number of the connection.
      2. MailServer$: The address to the mail server
      3. Port: Port number
      4. UserName$: Username or email address for login.
      5. Password$: Password for login.
      6. SSL: If 1, then an encrypted connection is established.
      7. Path$: Full path to the EML file.
      8. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • CountMailAttachmentsEx()
    • Syntax:
      Code:
      Result = CountMailAttachmentsEx(ID, @ErrorOutput$)

    • Description: Determines how many attachments exist in the current e-mail. This function is only valid within the ExamineMailEx loop.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: Number of attachments
  • ExamineMailAttachmentsEx()
    • Syntax:
      Code:
      Result = ExamineMailAttachmentsEx(ID, @ErrorOutput$)

    • Description: Starts the list of attachments from the current e-mail. This function is only valid within the ExamineMailEx loop or if GetMailAttachmentsEx() was previously called.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • NextMailEntryAttachmentsEx()
    • Syntax:
      Code:
      Result = NextMailEntryAttachmentsEx(ID, @ErrorOutput$)

    • Description: The next attachment of the current e-mail is determined.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryAttachmentsFileNameEx()
    • Syntax:
      Code:
      Result = MailEntryAttachmentsFileNameEx(ID, @Output, @ErrorOutput$)

    • Description: Determines the file name of the attachment from the current e-mail. This function is only valid within the ExamineMailAttachmentsEx loop or if GetMailAttachmentsEx() was previously called.
    • Parameter:
      1. ID: The number of the connection.
      2. @Output: File name of the attachment is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SaveMailEntryAttachmentsEx()
    • Syntax:
      Code:
      Result = SaveMailEntryAttachmentsEx(ID, Path$, @ErrorOutput$)

    • Description: Saves the attachment as a file on the hard disk. This function is only valid within the ExamineMailAttachmentsEx loop or if GetMailAttachmentsEx() was called before.
    • Parameter:
      1. ID: The number of the connection.
      2. Path$: Complete path including file name to which the attachment should be exported.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • FinishMailAttachmentsEx()
    • Syntax:
      Code:
      Result = FinishMailAttachmentsEx(ID, @ErrorOutput$)

    • Description: Closes the list of attachments from the current email. This function is only valid within the ExamineMailEx loop or if GetMailAttachmentsEx() was previously called.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetMailAttachmentsEx()
    • Syntax:
      Code:
      Result = GetMailAttachmentsEx(ID, MailID, DirectoryPath$, @ErrorOutput$)

    • Description: Defines the e-mail for the list of attachments. This function can be called before the ExamineMailAttachmentsEx loop so that the ExamineMailAttachmentsEx() function does not find all e-mails but the specified e-mail.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: Die Nummer der E-Mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetMailAttachmentsEx()
    • Syntax:
      Code:
      Result = SetMailAttachmentsEx(ID, MailID, DirectoryPath$, Attachments$, @ErrorOutput$)

    • Description: Adds files as attachments.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of the e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. Attachments$: Full path to the file to be added as an attachment. Multiple attachments can be separated with the | character.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • MailEntryAttributeEx()
    • Syntax:
      Code:
      Result = MailEntryAttributeEx(ID, @ErrorOutput$)

    • Description: Determines the status of the e-mail. This function is only valid within the ExamineMailEx loop. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The following constants can be queried:
      • #PBEx_Mail_Attribute_Unseen: E-mail has not yet been read.
      • #PBEx_Mail_Attribute_Seen: E-mail has already been read.
  • GetMailAttributeEx()
    • Syntax:
      Code:
      Result = GetMailAttributeEx(ID, MailID, DirectoryPath$, @ErrorOutput$)

    • Description: Determines the status of the e-mail using the MailID. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of the e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: The following constants can be queried:
      • #PBEx_Mail_Attribute_Unseen: E-mail has not yet been read.
      • #PBEx_Mail_Attribute_Seen: E-mail has already been read.
  • SetMailAttributeEx()
    • Syntax:
      Code:
      Result = SetMailAttributeEx(ID, MailID, DirectoryPath$, Attributes, @ErrorOutput$)

    • Description: Changes the status of the e-mail using the MailID. This function is not supported with POP3.
    • Parameter:
      1. ID: The number of the connection.
      2. MailID: The number of the e-mail.
      3. DirectoryPath$: The name or full path to the directory where the specified email is located. If empty, the inbox directory is selected.
      4. Attributes: The following constants can be used:
        • #PBEx_Mail_Attribute_Unseen: E-mail has not yet been read.
        • #PBEx_Mail_Attribute_Seen: E-mail has already been read.
      5. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.

Hint: With Google Mail it can happen that your own client is blocked for security reasons. To explicitly allow: Google Account > Security > Access by Less Secure Apps
Depending on the number of e-mails in a directory and the speed Internet, it may take some time.

System requirements:
  • Windows Vista or higher
  • .NET Framework 4.5 or higher
  • Unicode activation (default from PB 5.50)

Licence: This DLL file is free of charge and may be used both privately and commercially.
The following copyright texts must be provided:
Quote:
Copyright (c) 2012-2014 Torben Könke
MimeKit is Copyright (C) 2012-2018 Xamarin Inc.
Copyright © 2019 RSBasic.de


Download: http://www.rsbasic.de/downloads/downloa ... x_Mail.zip
Image

I would be very pleased about feedbacks, improvement suggestions, error messages or wishes. If you want to support me, you can also donate something. Thanks :)

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Tue Apr 30, 2019 7:02 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.1.0 has been released.

Changelog:
  • Added: CreateMailDirectoryEx()
  • Added: RenameMailDirectoryEx()
  • Added: DeleteMailDirectoryEx()
  • Added: CreateMalEx()
  • Added: BindMailEventEx(): #PBEx_Mail_Event_NewMail: This automatically calls a PB procedure as soon as new e-mails are available.
  • Added: GetMailSubjectEx()
  • Added: GetMailBodyEx()
  • Added: GetMailFromEx()
  • Added: GetMailToEx()
  • Added: GetMailCCEx()
  • Added: GetMailBCCEx()
  • Added: GetMailDateEx()
  • Added: GetMailPriorityEx()
  • Added: MailEntryBodySizeEx(): The size in bytes of body can be determined beforehand for allocating the memory.
  • Changed: MailEntryPriorityEx(): The name of the priority is no longer returned, but the value of one of the following constants: #PBEx_Mail_Priority_Normal, #PBEx_Mail_Priority_Low, #PBEx_Mail_Priority_High

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Thu May 02, 2019 8:56 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.2.0 has been released.

Changelog:
  • Added: MailIDEx()
  • Added: SetMailSubjectEx()
  • Added: SetMailBodyEx()
  • Added: SetMailFromEx()
  • Added: SetMailToEx()
  • Added: SetMailCCEx()
  • Added: SetMailBCCEx()
  • Added: SetMailPriorityEx()
  • Added: DeleteMailEx()
  • Added: MoveMailEx()
  • Added: CountMailEx()
  • Added: CountMailDirectoryEx()
  • Changed: CreateMailEx(): The MailID of the new e-mail is now returned.
  • Changed: GetMailSubjectEx()
  • Changed: GetMailBodyEx()
  • Changed: GetMailFromEx()
  • Changed: GetMailToEx()
  • Changed: GetMailCCEx()
  • Changed: GetMailBCCEx()
  • Changed: MessageID is now called MailID
  • Changed: Help descriptions for the individual functions

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Sat May 04, 2019 5:05 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.3.0 has been released.

Changelog:
  • Added: SendMailEx()
  • Added: SaveMailEx()
  • Added: GetMailHeaderEx()
  • Added: MailEntryHeaderEx()
  • Optimized: ExamineMailEx(): Better performance
  • Changed: CreateMailEx(): Directory parameter has been added.
  • Changed: SetMailSubjectEx(): Directory parameter has been added.
  • Changed: SetMailBodyEx(): Directory parameter has been added.
  • Changed: SetMailFromEx(): Directory parameter has been added.
  • Changed: SetMailToEx(): Directory parameter has been added.
  • Changed: SetMailCCEx(): Directory parameter has been added.
  • Changed: SetMailBCCEx(): Directory parameter has been added.
  • Changed: SetMailPriorityEx(): Directory parameter has been added.

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Sun May 05, 2019 12:59 am 
Offline
User
User

Joined: Thu Apr 18, 2019 8:17 am
Posts: 60
Thank you for this code, I definitely have a use for it in the near future.

Do you know if the version of .NET that it requires is pre-installed on at least Windows 7 and up? I'm thinking I may have to drop XP support for my program. My program is advertised as portable and won't have a Setup file, so being able for the user to just unzip and run my program with no further downloads is vital.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Sun May 05, 2019 9:21 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
Here you can see which .NET version is pre-installed and installable: https://docs.microsoft.com/de-de/dotnet ... pendencies
Many applications from the Internet are based on .NET and it has been standard for years and preinstalled on current operating systems.
Each of my systems has 4.0 and 4.5 installed.
You can also find out which .NET versions are installed: https://docs.microsoft.com/en-us/dotnet ... -installed

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Sun May 05, 2019 5:23 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.4.0 has been released.

Changelog:
  • Added: LoadMailEx()
  • Added: SendMailFileEx()

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Thu May 09, 2019 3:20 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.5.0 has been released.

Changelog:
  • Added: CountMailAttachmentsEx()
  • Added: ExamineMailAttachmentsEx()
  • Added: NextMailEntryAttachmentsEx()
  • Added: MailEntryAttachmentsFileNameEx()
  • Added: SaveMailEntryAttachmentsEx()
  • Added: FinishMailAttachmentsEx()
  • Added: GetMailAttachmentsEx()
  • Added: SetMailAttachmentsEx()
  • Changed: SendMailEx(): Attachments can now be added.
  • Changed: CreateMailEx(): Attachments can now be added.
  • Changed: SendMailFileEx(): Attachments are now taken into account.
  • Changed: LoadMailEx(): Attachments are now taken into account.
  • Changed: OutputError$ must be reserved with 128 characters before passing. Maximum length of the return is 128 characters including the NULL character.
  • Changed: OutputError$: This parameter is now optional and can be 0.
  • Optimized: POP3
  • Bugfixes

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Thu May 09, 2019 8:47 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.6.0 has been released.

Changelog:
  • Added: MailEntryAttributeEx(): This can be used to determine whether the e-mail was read.
  • Added: SetMailAttributeEx(): This allows you to mark an e-mail as read or unread.
  • Added: GetMailAttributeEx(): This can be used to determine whether the e-mail was read.

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Mon May 13, 2019 12:54 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.7.0 has been released.

Changelog:
  • Bugfix: NextMailEntryEx(): If the date field was NULL, it failed.

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Wed May 15, 2019 4:09 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.8.0 has been released.

Changelog:
  • Changed: ExamineMailEx(): Added new parameter to set the order of determination. If SortByNew = 0, then the first e-mail is determined first. If SortByNew = 1, then the newest e-mail is determined first.
  • Changed: ExamineMailEx(): Added new parameter to detect emails of a certain flag (all, read only, unread only).
  • Changed: ExamineMailEx(): Added a new parameter to specify whether only header data or all data should be determined.

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex Mail (Windows)
PostPosted: Fri May 17, 2019 7:41 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 831
Location: Berlin and Ibiza
PB.Ex Mail 1.0.9.0 has been released.

Changelog:
  • Changed: @Output$: If 0 is passed, then the required length for allocating the memory is returned as the return value of the respective function.

_________________
ImageImageImageImageImage


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye