$mail

Manages mailing.
Syntax
    see Documentation
DocumentationSending mail messages:

Adds the specified attachment to the current mail message: $mail{addAttachment}{attachment}{content_type}

    Parameters:
      addAttachment, a flag to indicate that an attachment is to be added to the current mail message.
      attachment, the attachment contents.
      content_type, the type of the attachment contents.
Creates a new mail message: $mail{createMessage}{from}{recipients}{subject}{content_type}{content}


    Parameters:
      createMessage, a flag to indicate that a mail message is to be created.
      from, the sender of the mail.
      recipients, the recipients of the mail.
      subject, the mail subject.
      content_type, the type of the mails contents.
      content, the mails contents.
    NOTE:
      the mail message created will be the current for sending (see also $mail{send}).
Sends the current mail: $mail{send}

    Parameters:
      send, a flag to indicate that the current message is to be send.
Sends the current message and waits for response by failure: $mail{sendAndWait}

    Parameters:
      sendAndWait, a flag to indicate that the current message is to be send.
Retrieving messages from a store:

Deletes the specified message: $mail{delete}{message_id}

    Parameters:
      delete, a flag to indicate that the specified message shall be deleted.
      massage_id, the id of the message to be deleted.
Returns the body of the specified message: $mail{getBody}{body_index}

    Parameters:
      getBody, a flag to indicate that the body of the current message is requested.
      body_index, the index of the requested body of the current message.
    Returns:
      whatever the content of the specified body is.

    Parameters:
      getBodyCount, a flag to indicate that the number of bodies of the current message is requested.
    Returns:
      the number of bodies of the current message.
Returns the name of the specified message body: $mail{getBodyName}{body_index}

    Parameters:
      getBodyName, a flag to indicate that the name of the specified body of the current message is requested.
      body_index, the index of the body of the current message.
    Returns:
      if the body has a name then it will be returned else nothing is returned.
Returns the content type of the specified message body: $mail{getBodyType}{body_index}

    Parameters:
      getBodyType, a flag to indicate that the content type of the specified body of the current message is requested.
      body_index, the index of the body of the current message.
    Returns:
      whatever the type of the content of the specified body is.
Returns the FROM header entry of the current message: $mail{getFrom}

    Parameters:
      getFrom, a flag to indicate that the FROM header entry of the current message is requested.
    Returns:
      the address of the sender of the current message.
Returns the specified header of the current message: $mail{getHeader}{header_name}

    Parameters:
      getHeader, a flag to indicaten that the value of the specified header is requested.
      header_name, the name of the header of the current message whos value is requested.
    Returns:
      the value of the named header or nothing if no such header exists.
Returns the names of all headers of the current message: $mail{getHeaderNames}

    Parameters:
      getHeaderNames, a flag to indicaten that the names of all headers of the current message are requested.
    Returns:
      a $\n separated list of all header names of the current message.
Returns the number of avaliable mail messages: $mail{getMessageCount}

    Parameters:
      getMessageCount, a flag to indicate that the number of messages is requested.
    Returns:
      the number of email messages in the 'INBOX' folder.
Returns the id of the current message: $mail{getMessageID}

    Parameters:
      getMessageID, a flag to indicate that the id of the current message is requested.
    Returns:
      the id of the current message.
Returns the ReplyTo header entry of the current message: $mail{getReplyTo}

    Parameters:
      getReplyTo, a flag to indicate that the ReplyTo header entry of the current message is requested.
    Returns:
      the value of the ReplyTo header entry.
Returns the name of the sender of the current message: $mail{getSender}

    Parameters:
      getSender, a flag to indicate that the name of the name of the sender of the current message is requested.
    Returns:
      the name of the sender of the current message.
Returns the subject of the current message: $mail{getSubject}

    Parameters:
      getSubject, a flag to indicate that the subject of the current message is requested.
    Returns:
      the subject of the current message.
Returns the time the current message was send: $mail{getTimeSend}

    Parameter:
      getTimeSend, a flag to indicate that the time the current message was send is requested.
    Returns:
      the time the current message was send.
Returns the recipients of the type TO: $mail{getTo}

Parameters:
    getTo, a flag to indicate that the recipients of type TO of the current message are requested.
Returns:
    Returns the recipients of the type TO of the current message.
Returns the uidl of the current message: $mail{getUIDL}

Parameters:
    getUIDL, a flag to indicate that the uidl of the current message is requested.
Returns:
    the uidl of the current message.
Examines if more messages exist: $mail{hasNext}

    Parameters:
      hasNext, a flag to indicate that the existance of the next message is to be examined.
    Returns:
      1 if and only if another message exists: 0 otherwise.
Logs the named user to the specified mail-server: $mail{login}{host}{username}{password}{port}

    Parameters:
      login, a flag to indicate that a login is requested.
      host, the name or IP address of the mail-server.
      username, the name of the user.
      password, the password of the user.
      port, a optional parameter to specify a port value other than 25; defaults to the value 25.
Ends the session with the mail-server: $mail{logout}

    Parameters:
      logout, aflag to indicate that the end of the session is requested.
Sets the current message to be the next: $mail{next}

Parameters:
    next, a flag to indicate that the current message shall be the next in the 'INBOX' folder.
Returns:
    1 if and only if another message exists: 0 otherwise.
Examples
GroupNet
Minimum required transaction-mode:NONE
Required scripting permission of the developerPERMISSION_FL_EXPERT
Minimum parameters0
Maximum parameters 0