195 bool importance = False;
196 bool deliveryReceipt = False;
197 bool readReceipt = False;
211 *
string bodyContentType;
214 list<Attachment> attachments();
222 bool smtp_mode = True;
228 string mpboundary = replace(make_base64_string(
string(now_us())),
"=",
"");
243 constructor(
string sender,
string subject,
bool smtp_mode = True);
262 processPart(hash<auto> p);
278 list<string>
addTO(
string recipient);
287 list<string>
addCC(
string recipient);
536 static string doHeaderValue(
string hdr,
string val,
string eol =
'\r\n',
bool encode = True);
581 static string encodeData(data data,
string mime,
string disp,
string enc);
590 static string getLine(reference<string> msg, reference<int> pos);
594 list<string> getEnvelopeList();
626 constructor(
string filename,
string mimetype, data filedata,
string encoding =
EncDefault, *hash<auto> hdr);
651 add(MultiPartAlternativeMessage mpa);
692 add(MultiPartMixedMessage mpm);
class representing a MIME Attachment for the Message
Definition: MailMessage.qm.dox.h:671
constructor(string name, string mime, data part_data, string enc=EncBase64, *hash< auto > hdr)
creates an Attachment object for a Message object
add(MultiPartMixedMessage mpm)
adds itself to a multipart/mixed message
The Message class holds the information for a single email Message.
Definition: MailMessage.qm.dox.h:182
constructor(string sender, string subject, bool smtp_mode=True)
creates a Message object from the arguments given
receiptDelivery(bool arg)
sets the delivery receipt setting
string mpboundary
create a different multipart boundary string every time based on the current time
Definition: MailMessage.qm.dox.h:228
string getBodyTransferEncoding()
returns the transfer encoding for the mssage body (see Message Encodings for possible values)
bool important()
returns the current importance setting
string toString(bool include_body=False)
returns a multi-line string representing the Message
list< string > addTO(string recipient)
add a recipient to the Message's recipient list
addHeader(string hdr)
adds a header to the Message
bool receiptRead()
returns the current read delivery receipt setting
attach(Attachment att)
adds an Attachment to the Message
static string doHeaderValue(string hdr, string val, string eol='\r\n', bool encode=True)
encodes a header value according to the parameters
static string encodeData(data data, string mime, string disp, string enc)
returns a string of message data according to the encoding passed
checkSendPossible()
throws a MESSAGE-ERROR exception if the Message cannot be sent
string serialize()
serializes the message to a string that can be sent to an SMTP server, for example
static string getLine(reference< string > msg, reference< int > pos)
returns the first "\r\n" terminated line from the argument, updates the byte position argument
setBody(data body, string enc=EncDefault, *string content_type)
sets or replaces the Message body
addHeader(list< auto > hdrs)
adds a list of headers to the Message
list< string > addBCC(string recipient)
add a recipient to the Message's bcc list
static bool checkEmailAddress(string str)
returns True if the string contains an email address, False if not
setHeader(hash hdrs)
sets/replaces the list of Message headers from a hash of header info
static string encodeTransferData(data data, string enc, reference< hash > hdr)
returns a string of message data according to the encoding passed
string getHeaderString(string eol='\r\n', bool encode=True)
returns a string of the message headers
receiptRead(bool arg)
sets the read delivery receipt setting
setHeader(list hdrs)
sets/replaces the list of Message headers from a list of header strings
list< Part > getParts()
returns a list of non-attachment Part objects for the Message
*data getBody()
returns the Message body
attach(string name, string mime, data att, string enc=EncBase64, *hash< auto > hdr)
creates an attachment for the Message
list< string > addCC(string recipient)
add a recipient to the Message's cc list
string toLine()
returns a single line string summarizing the Message
list< string > getRecipients()
return all the email addresses the message will be sent to, a combination of the "To:",...
list< Attachment > getAttachments()
returns a list of Attachment objects for the Message
static *string getEmailAddress(string str)
fetch the email address out of a sender/rcpt string
*string getFrom()
returns the sender's email address
static string checkEncoding(data data, string enc, bool noneok=False)
checks the data against the encoding and returns the new encoding (if the encoding is EncDefault for ...
list< string > getTO()
returns the list of "To:" addresses
list< string > getBCC()
returns the list of "BCC:" addresses
bool receiptDelivery()
returns the delivery receipt setting
setHeader(string hdr)
sets/replaces the Message headers
string getSubject()
returns the subject of the Message
softlist getHeader()
returns the current Message headers as a list of strings
bool sendPossible()
returns True if the message can be sent, False if not
addBody(string str)
concatenates a string to the message body
important(softbool i)
sets the importance setting
*string getSender()
returns the sender's address in display format
addHeader(hash< auto > hdrs)
adds a hash of headers to the Message
*hash< auto > getHeaders()
returns the current Message headers as a hash
constructor(string msg)
creates a Message object from raw message text from a received email message
list< string > getCC()
returns the list of "CC:" addresses
static hash parseHeader(string hdr, bool decode=True)
parses the given string representing a header line and returns a single key - value hash for the head...
addBody(binary bin)
concatenates a binary object to the message body
class representing a MIME part of a Message
Definition: MailMessage.qm.dox.h:607
add(MultiPartAlternativeMessage mpa)
adds itself to a multipart/alternative message
string getTransferEncoding()
returns the transfer encoding of the Part
*hash< auto > getHeaders()
returns any headers for the Part
string getName()
returns the name of the Part
string getMime()
returns the mime type of the Part
data getData()
returns the data of the Part
const EncBase64
base-64 content transfer encoding
Definition: MailMessage.qm.dox.h:134
const EncQuotedPrintable
"quoted-printable" content transfer encoding
Definition: MailMessage.qm.dox.h:137
const EncDefault
Definition: MailMessage.qm.dox.h:128
const EncNone
no content transfer encoding (not recommended as SMTP servers break up long lines automatically)
Definition: MailMessage.qm.dox.h:131
const Encodings
a list of all known content encoding schemes encodings
Definition: MailMessage.qm.dox.h:140
the MailMessage namespace holds all public definitions in the MailMessage module
Definition: MailMessage.qm.dox.h:119