PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 24 → Send E-Mail
Send E-Mail
Débuté par adrianoboller, 09 fév. 2015 15:55 - Aucune réponse
Membre enregistré
2 962 messages
Popularité : +89 (91 votes)
Posté le 09 février 2015 - 15:55
SendEmail("adrianoboller@gail.com","Monitor de Atividade SQL","Teste do sistema de mensagem de erro do monitor de atividade sql 465","")

Procedure SendEmail(Destinatario, Assunto, Mensagem, Anexo)

EmailSetTimeOut(30)

UserName, Senha is string = ""

UserName = "adrianoboller@gmail.com"
Senha = "777777"

IF EmailStartSMTPSession(UserName, Senha,"smtp.gmail.com", 587, False, emailOptionSecuredTLS) = True THEN

MonMessage est un Email
MonMessage..Expediteur = UserName
Ajoute(MonMessage..Destinataire, Destinatario)

MonMessage..Sujet = Assunto
MonMessage..Message = Mensagem
MonMessage..AccuséRéception = Vrai


IF Anexo <> "" AND Length(Anexo) > 3 THEN
EmailLoadAttachment(MonMessage,Anexo)
END

// Sends the email
ok is boolean = EmailSendMessage(UserName, MonMessage)
IF ok = False
ToastDisplay(Error(),toastLong,vaMiddle,haCenter)
ELSE
ToastDisplay("Email enviado com sucesso!",toastLong,vaMiddle,haCenter)
END

EmailCloseSession(UserName)

ELSE
ToastDisplay(Error("Unable to establish connection", ErrorInfo(), ...
"In case of time-out, check the parameters of the "+ ...
"""Firewall"" on the port used (587)"),toastLong,vaMiddle,haCenter)
END