;
; ------------------------------------------------------------
;
; PureBasic - Mail example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
InitNetwork()
If CreateMail(0, "fred@purebasic.com", "Hello !")
SetMailBody(0, "Hello !" + #CRLF$ +
"This is a multi-" + #CRLF$ +
"line mail !")
AddMailAttachment(0, "Geebee !" , "Data/Geebee2.bmp")
AddMailAttachment(0, "World icon", "Data/world.png")
; Измените получателей на реальных
;
AddMailRecipient(0, "test@yourdomain.com", #PB_Mail_To)
AddMailRecipient(0, "test_cc@yourdomain.com", #PB_Mail_Cc)
; Установите используемый SMTP-сервер
;
Result = SendMail(0, "smtp.free.fr", 25, #PB_Mail_Asynchronous)
Repeat
Progress = MailProgress(0)
Delay(300)
Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
If Progress = #PB_Mail_Finished
MessageRequester("Инфо", "Почта корректно отправлена !")
Else
MessageRequester("Ошибка", "Почта НЕ отправлена !")
EndIf
EndIf