WebSmtpDataEx Function

Action

Sends the mail message using a standard mail header with the most important arguments: sender, recipient, subject.

Include file

WebAPI.bdh

Syntax

WebSmtpDataEx( in hSmtp    : number,
               in sTo      : string,
               in sFrom    : string,
               in sSubject : string,
               in sBody    : string ): boolean;

Return value

  • true if the server responded with a positive return code

  • false otherwise

Parameter Description
hSmtp Handle to a Web connection that was created by WebSmtpConnect
sTo Recipient’s e-mail address. Sample: "Jim Jason<jim@mailprovider.com>"
sFrom Sender’s e-mail address
sSubject Subject of the e-mail
sBody The custom mail body
注: Only 7-bit text data or MIME-encoded binaries in ASCII 128 format can be used as message body.

Example

dcltrans
  transaction TWebSmtp
  var
    hSmtp: number;
  begin
    WebSmtpConnect(hSmtp, "standardhost", WEB_PORT_SMTP);
    WebSmtpHello(hSmtp, "<MyDomain>");
    WebSmtpMail(hSmtp, "<john@mail.com>");
    WebSmtpRecipient(hSmtp, "<admin@mail.com>");
    WebSmtpDataEx(hSmtp,"admin<admin@mail.com>",
                       "SenderName", "ThisIsTheSubject",
                       "This is a testmessage");
    WebSmtpQuit(hSmtp);    WebSmtpShutdown(hSmtp);
  end TWebSmtp;

SilkEssential sample

eMail.sep