|
|
@ -8,6 +8,8 @@ Global PBEx_Mail |
|
|
|
#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 |
|
|
|
|
|
|
|
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 |
|
|
|
PBEx_Mail = OpenLibrary(#PB_Any, "PB.Ex_Mail_x86.dll") |
|
|
@ -60,7 +62,7 @@ If PBEx_Mail |
|
|
|
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, ErrorOutput) |
|
|
|
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") |
|
|
@ -106,7 +108,7 @@ If PBEx_Mail |
|
|
|
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, ErrorOutput) |
|
|
|
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") |
|
|
@ -118,11 +120,33 @@ If PBEx_Mail |
|
|
|
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$ = "" |
|
|
|
Global ErrorOutput$ = Space(128) |
|
|
|
|
|
|
|
Procedure NewMail(MailID$) |
|
|
|
Protected MailID = Val(MailID$) |
|
|
@ -138,7 +162,7 @@ Procedure NewMail(MailID$) |
|
|
|
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) |
|
|
|
; |
|
|
@ -160,24 +184,34 @@ If OpenMailEx(1, #PBEx_Mail_Protocol_IMAP, "imap.gmail.com", 993, "yourmailaddre |
|
|
|
; Wend |
|
|
|
; |
|
|
|
; EndIf |
|
|
|
|
|
|
|
|
|
|
|
;Determine all mail from inbox |
|
|
|
;Or from any directory |
|
|
|
;SetMailDirectoryEx(1, "Downloadportale/Chip", @ErrorOutput$) |
|
|
|
; If ExamineMailEx(1, @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 "--------------------------------------------------" |
|
|
|
; Wend |
|
|
|
; |
|
|
|
; EndIf |
|
|
|
If ExamineMailEx(1, @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 |
|
|
@ -186,14 +220,14 @@ EndIf |
|
|
|
|
|
|
|
CloseLibrary(PBEx_Mail) |
|
|
|
|
|
|
|
; IDE Options = PureBasic 5.60 (Windows - x64) |
|
|
|
; CursorPosition = 145 |
|
|
|
; FirstLine = 117 |
|
|
|
; IDE Options = PureBasic 5.70 LTS (Windows - x64) |
|
|
|
; CursorPosition = 155 |
|
|
|
; FirstLine = 123 |
|
|
|
; Folding = - |
|
|
|
; EnableXP |
|
|
|
; EnableUser |
|
|
|
; Executable = PB.Ex_MSSQL.exe |
|
|
|
; CompileSourceDirectory |
|
|
|
; EnableCompileCount = 650 |
|
|
|
; EnableCompileCount = 777 |
|
|
|
; EnableBuildCount = 7 |
|
|
|
; EnableUnicode |