All Classes Namespaces Functions Variables Groups Pages
MailMessage Module

# MailMessage Module Introduction

The MailMessage module provides the MailMessage class for representing represents an email message. This module is used by the SmtpClient and Pop3Client modules.

To use this module, use `"%requires MailMessage"` in your code. See the SmtpClient and Pop3Client modules for examples of Qore code using this module

All the public symbols in the module are defined in the MailMessage namespace

The main classes are:

- Message: wraps an email message
- Attachment: used for files attached to a Message

Example:
  #!/usr/bin/env qore
  %requires MailMessage
  my MailMessage::Message msg("Me, Myself, and I <me@email.com>", "My Subject");
  msg.setBody("hello world!");
  msg.addTO("My Best Friend <you@friend.com>");

# MailMessage Release Notes

## mailmessage_v1_3_1

- fixed Message::addBody() with no body present (issue issue 2360)

## mailmessage_v1_3

- added support for complex types

## mailmessage_v1_2_1

- fixed a bug using the default encoding in Message::attach() (issue issue 1352)

## mailmessage_v1_2

- converted to %new-style

## mailmessage_v1_1

- added the Message::serialize() method

## mailmessage_v1_0_4

- minor doc corrections and non-functional code changes

## mailmessage_v1_0_3

- requires Mime module 1.3 for the MultiPartMessage::parseBody() method
- fixed a bug where the part/attachment content-type was set to the content-type of the message
- try to get the filename of attachments from the content-type header if not set in the content-disposition header
- message parts that themselves have parts are now supported
- fixed recognizing mime messages with additional text after the version number (ex: "Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))")

## mailmessage_v1_0_2

- use <string>::isPrintableAscii() to determine which mail headers need encoding

## mailmessage_v1_0_1

- fixed a bug encoding mail headers where mail headers requiring encoding were not encoded and those not requiring encoding were encoded with Q encoding

## mailmessage_v1_0

- moved from the SmtpClient module to an independent module to also support the Pop3Client class