MailOutBoxCreate

function

Library: Email support, SMTP and POP3 (OMMAIL)
Include: ommail.xin

Returns: a MailOutBox object


Declaration
define external MailOutBox function MailOutBoxCreate
   name    value string sender-name
   address value string address
   server  value string server optional initial {"mail"}
   user     value string user     optional
   password value string password optional

Argument definitions

sender-name
is the name of the person sending the message.
address
is the email address of the person sending the message.
server
is the name of the outgoing SMTP server.
user
is the user name for the SMTP account
password
is the password for the SMTP account


Purpose

This function creates and returns a MailOutBox object with the given configuration information. The MailOutBox is an OMX component used by the outgoing mail functions in the mail library.

If the SMTP server requires users to authenticate themselves before sending mail, you must specify the user and password. You must specify name and password together. It is an error to specify one without the other.

There are multiple protocols used to implement authentication on an SMTP server. The OMMAIL library will select the appropriate protocol automatically, however, OMMAIL does not support all protocols. OMMAIL supports the LOGIN and PLAIN authentication protocols, but does not support SSL encryption.

Examples:


  ; create a mailbox using the default server, "mail"
  process
      local MailOutBox this-MailOutBox
      set this-MailOutBox to
      MailOutBoxCreate name "George" address "[email protected]"
  
  ; create a mailbox using a server other than "mail" on a server that require authentication
  process
      local MailOutBox this-MailOutBox
      set this-MailOutBox to
      MailOutBoxCreate name "Jim" address "[email protected]" server "specialMail" user "Jim" password "x9hdt45j"