WebDev 24. EMail. The session is closed February 19, 2024 01:37PM |
Registered: 5 years ago Posts: 68 |
PROCEDURE ZendStdMail(pcBestemmeling,pcSubject,pcHtmlText) cMailText is string = HTMLToText(pcHtmlText) lTerug is boolean = False // Send an email cSMTPServer is string = INIRead(“MAILSETTINGS”,“smtpserver”,“”,fExeDir()+“\settings.ini”) cSMTPUser is string = INIRead(“MAILSETTINGS”,“smtpuser”,“”,fExeDir()+“\settings.ini”) cSmtpPort is string = INIRead(“MAILSETTINGS”,“smtpport”,“”,fExeDir()+“\settings.ini”) cSmtpPassword is string = INIRead(“MAILSETTINGS”,“smtppassword”,“”,fExeDir()+“\settings.ini”) // Build the message MyMessage is Email MyMessage..ReturnReceipt = True IF ExtractString(pcBestemmeling,1) = pcBestemmeling THEN Add(MyMessage..Recipient,pcBestemmeling) ELSE // Er zitten meerdere bestemmelingen in pcBestemmeling FOR EACH STRING cAdres OF pcBestemmeling Add(MyMessage..Bcc,cAdres) END END MyMessage..Subject = pcSubject MyMessage..Message = HTMLToText(cMailText) MyMessage..HTML = pcHtmlText MyMessage..Sender = cSMTPUser IF cSMTPServer = "smtp.gmail.com" THEN IF EmailStartSMTPSession(cSMTPUser, cSmtpPassword, ... "smtp.gmail.com", 587, False, emailOptionSecuredTLS) = True THEN // Procedure used to initialize the email structure //Initialize_Email() // Sends the email IF EmailSendMessage(cSMTPUser,MyMessage) = False THEN Error() ErrorInfo() lTerug = False ELSE lTerug = True END EmailCloseSession(cSMTPUser) ELSE END ELSE // Start a SMTP session MySession is emailSMTPSession MySession..ServerAddress = cSMTPServer MySession..Port = cSmtpPort MySession..Password = cSmtpPassword MySession..Name = cSMTPUser MySession.Option = optionSSL EmailStartSession(MySession) IF EmailSendMessage(MySession, MyMessage) ELSE Error(ErrorInfo()) END END RESULT lTerug
Re: WebDev 24. EMail. The session is closed February 19, 2024 01:44PM |
Registered: 5 years ago Posts: 299 |
Re: WebDev 24. EMail. The session is closed February 20, 2024 09:47AM |
Registered: 5 years ago Posts: 68 |
Re: WebDev 24. EMail. The session is closed February 20, 2024 10:45AM |
Registered: 5 years ago Posts: 299 |
Re: WebDev 24. EMail. The session is closed February 21, 2024 05:36PM |
Registered: 5 years ago Posts: 8 |
Re: WebDev 24. EMail. The session is closed February 23, 2024 10:14AM |
Registered: 5 years ago Posts: 68 |
[Mail settings] ! smtp... ! Password ! user ...
[Mail settings] SMTP... Password.. user