Code:
Structure _NLSettingsCGI
MAILGATE.s
PORT.i
SSL.i
USER.s
PWD.s
SENDERNAME.s
SENDEREMAIL.s
REPORTEMAIL.s
CGIPATH.s
DOCPATH.s
OpenMailExID.i
EndStructure
Structure SendEmail_Parameter
Sender_Name.s ; Name of Sender
Sender_Email.s ; Address of Sender
RecipientTO.s ; List of Recipient Addresses (';' separated)
RecipientCC.s ; List of Carbon-Copy-Recipient Adresses (';' separated)
RecipientBCC.s ; List of Blind-Carbon-Copy-Recipient Adresses (';' separated)
ReplyTO.s ; Antwort abweichend vom Sender
Undisclosed.b ; if TRUE all recipients are hidden in the email
UserName.s ; Username for Authentication
Password.s ; Password for Authentication
SMTPServer.s ; Address of SMTP Server
port.w ; Port of SMTP Server
Subject.s ; Subject of Email (nur ASCII zulässig)
message.s ; Text-Body
MessageHtml.s ; HTML-Body
ContentType.s ; text/plain; charset=utf-8
Hostname.s ; Hostname used for HELO/EHLO introduction
ProgressAttachedFile.l ; Address of Callback procedure for attached files
Protocol_Enable.b ; if Protocol should be written or not
Protocol.s ; Protocol
TimeOut.l ; Timeout Value in Seconds
List Attachments.s() ; List of Attachments
EndStructure
Procedure SendEMail (*mpara.SendEmail_Parameter, *MailSet._NLSettingsCGI)
Protected ErrorOutput$, Attachment.s, Sender.s
*MailSet\OpenMailExID = 1
*MailSet\MAILGATE = "192.168.150.219"
*MailSet\PORT = 25
*MailSet\USER = ""
*MailSet\PWD = ""
*MailSet\SSL = 0
*mpara\Subject = "Test"
*mpara\MessageHtml = "<h1>It works</h1>"
Sender = "x@y.z"
*mpara\RecipientTO = "a@b.c"
Debug "OpenMailEx().."
OpenMailEx(*MailSet\OpenMailExID, #PBEx_Mail_Protocol_SMTP, *MailSet\MAILGATE, *MailSet\PORT, *MailSet\USER, *MailSet\PWD, *MailSet\SSL, @ErrorOutput$)
Debug "Error: " + ErrorOutput$
Debug "SendMailEx().."
SendMailEx(*MailSet\OpenMailExID, *mpara\Subject, *mpara\MessageHtml, #PBEx_Mail_Priority_Normal, Sender, *mpara\RecipientTO, *mpara\RecipientCC, *mpara\RecipientBCC, Attachment, @ErrorOutput$)
Debug "Error: " + ErrorOutput$
EndProcedure
Define time.i = ElapsedMilliseconds()
Define mpara.SendEmail_Parameter, MailSet._NLSettingsCGI
SendEMail(mpara, MailSet)
PB 5.70 x86, Windows 10
SendMailEx() crasht..