;
; ------------------------------------------------------------
;
; PureBasic - Mail example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
InitNetwork()
If CreateMail(0, "fred@purebasic.com", "Hello !")
SetMailBody(0, "Hello "+Chr(10)+"This is a mail !")
AddMailAttachment(0, "My description", "brook_3d.png")
AddMailAttachment(0, "My description 2", "test.bmp")
AddMailRecipient(0, "test@yourdomain.com", #PB_Mail_To)
AddMailRecipient(0, "test2@yourdomain.com", #PB_Mail_Cc)
Result = SendMail(0, "smtp.free.fr", 25, 1)
Repeat
Progress = MailProgress(0)
Delay(300)
Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
If Progress = #PB_Mail_Finished
MessageRequester("Information", "Mail correctly sent !")
Else
MessageRequester("Error", "Can't sent the mail !")
EndIf
EndIf