Sending Mail
Posted: Sun Dec 14, 2014 11:47 pm
I've seen a lot of old topics about this, but since the documentation shows the methods for sending e-mail, i'm confused. Does PureBasic sends e-mail or not? Or depends on what?
I'm trying this code, changing the mail informations, and it stays in loop forever.
I'm totally new in PB, dont know where to start.
I'm trying this code, changing the mail informations, and it stays in loop forever.
Code: Select all
If InitNetwork()
If CreateMail(0, "xxxx@xxxx.com.br", "Subject test")
SetMailBody(0, "This is the body...")
AddMailRecipient(0, "xxxxxxxx@gmail.com", #PB_Mail_To)
Debug IsMail(0)
Debug "started...."
Result = SendMail(0, "xxxx.xxxx.com.br", 25 , 1, "xxx@xxxxx.com.br", "xxxxxx")
Repeat
Progress = MailProgress(0)
Delay(300)
Debug Progress
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
FreeMail(0)
EndIf
Else
Debug "Didnt work...."
EndIf