Click or drag to resize

CSmtp Class

X#
Provide a class for Internet Protocol SMTP.
Inheritance Hierarchy
Object
  CMailAbstract
    CSmtp

Namespace:  VO
Assembly:  VOInternetClasses (in VOInternetClasses.dll) Version: 2.19
Syntax
 CLASS CSmtp INHERIT CMailAbstract
Request Example View Source

The CSmtp type exposes the following members.

Constructors
  NameDescription
Public methodCSmtp
Construct a CSmtp object.
Top
Properties
  NameDescription
Public propertyDomainName
**Missing documentation **
(Inherited from CMailAbstract.)
Public propertyEmail
An instance of the CEmail class.
Public propertyEmailFormat
The format of the email.
Public propertyError
Numeric value representing the last occurring error code.
(Inherited from CMailAbstract.)
Public propertyErrorMsg
A string representing the error description.
(Inherited from CMailAbstract.)
Public propertyMailApplication
A string that holds the name that is used when connection to mail servers
Public propertyPassWord
A string representing the password to be used.
(Inherited from CMailAbstract.)
Public propertyRemoteHost
String representing the address of the mail server.
(Inherited from CMailAbstract.)
Public propertyRemotePort
Numeric value representing the port number.
(Inherited from CMailAbstract.)
Public propertyReplyCode
Numeric value representing the server's reply code.
(Inherited from CMailAbstract.)
Public propertyReplyString
String representing the server's reply.
(Inherited from CMailAbstract.)
Public propertySecureSMTP
A logic indicating if the CSmtp class should use Secure SMTP
Public propertyTextEncoding
The text encoding type of the email.
Public propertyTimeout
Numeric value representing the time-out in milliseconds.
(Inherited from CMailAbstract.)
Public propertyTimeoutRetries
**Missing documentation **
(Inherited from CMailAbstract.)
Public propertyUserName
A string containing the user name to be used.
(Inherited from CMailAbstract.)
Top
Methods
  NameDescription
Public methodCode exampleCheckReply
Check the response from a mail server for error codes.
Public methodClose
De-initialize all internal values of an Internet session.
(Inherited from CMailAbstract.)
Public methodCode exampleconnect
Establish a connection to a remote SMTP server.
Public methodDestroy
**Missing documentation **
(Inherited from CMailAbstract.)
Public methodCode exampleDisconnect
Shut down the current SMTP connection.
Public methodInternetStatus
**Missing documentation **
(Inherited from CMailAbstract.)
Public methodLogon
Logs on to the remote host with the user name and password of the smtp class
Public methodOpen
Initialize all internal startup values for an Internet session.
(Inherited from CMailAbstract.)
Public methodRecvRemote
Receive response data from a remote mail server.
(Overrides RecvRemote.)
Public methodSendData
Send data to a remote host.
(Inherited from CMailAbstract.)
Public methodSendHeaderInfo
Create a mail header and send it as part of an e-mail to a remote SMTP server.
Public methodSendMail
Send a complete e-mail to a remote SMTP server.
Public methodSendRaw
**Missing documentation **
(Inherited from CMailAbstract.)
Public methodSendRemote
Send any data to a remote host.
(Inherited from CMailAbstract.)
Top
Fields
  NameDescription
Public fieldoSocket (Inherited from CMailAbstract.)
Top
Remarks
This class provides all necessary methods and properties for sending e-mail to a Simple Message Transfer Protocol (SMTP) server.
Examples
X#
 1FUNCTION SMTPSendMail       (cServerIP      AS STRING,;
 2     cMailSubject   AS STRING,;
 3     xDestUser      AS USUAL,;
 4     xCCUser        AS USUAL,;
 5     cBody          AS STRING,;
 6     cFromAddress   AS STRING,;
 7     xAttachFile    AS USUAL,;
 8     cFromName      AS STRING,;
 9     xBCCUser       AS USUAL,;
10     cCargo         AS STRING)   AS LOGIC PASCAL
11  LOCAL oSmtp    AS CSMTP
12  LOCAL lRet     AS LOGIC
13  LOCAL oEmail   AS CEmail
14  oEMail := CEmail{}
15  oEmail:FromAddress   := cFromAddress
16  oEmail:FromName      := cFromName
17  oEmail:Cargo         := cCargo
18  oEmail:Subject       := cMailSubject
19  oEmail:DestList      := xDestUser
20  oEmail:CCList        := xCCUser
21  oEmail:BCCList       := xBCCUser
22  oEmail:MailBody        := cBody
23  IF !IsNil(xAttachFile)
24     oEmail:AttachmentFileList := xAttachFile
25  ENDIF
26  oSmtp := CSmtp{oEmail}
27  oSMtp:RemoteHost  := cServerIP
28  oSmtp:TimeOut := 5000
29  lRet := oSmtp:SendMail()
30  RETURN lRet
See Also

Reference