268 bool importance = False;
269 bool deliveryReceipt = False;
270 bool readReceipt = False;
284 *
string bodyContentType;
287 list<Attachment> attachments();
295 bool smtp_mode = True;
301 string mpboundary = replace(make_base64_string(
string(now_us())),
"=",
"");
316 constructor(
string sender,
string subject,
bool smtp_mode = True);
339 processPart(hash<auto> p);
355 list<string>
addTO(
string recipient);
364 list<string>
addCC(
string recipient);
613 static string doHeaderValue(
string hdr,
string val,
string eol =
'\r\n',
bool encode = True);
658 static string encodeData(data data,
string mime,
string disp,
string enc);
667 static string getLine(reference<string> msg, reference<int> pos);
671 list<string> getEnvelopeList();
703 constructor(
string filename,
string mimetype, data filedata,
string encoding =
EncDefault, *hash<auto> hdr);
732 add(MultiPartAlternativeMessage mpa);
773 add(MultiPartMixedMessage mpm);
class representing a MIME Attachment for the Message
Definition MailMessage.qm.dox.h:752
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:255
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:301
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 ...
hash< MailMessageInfo > getInfo()
Returns information about the message.
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:684
hash< auto > getInfo()
Returns information about the part.
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:207
const EncQuotedPrintable
"quoted-printable" content transfer encoding
Definition MailMessage.qm.dox.h:210
const EncDefault
Definition MailMessage.qm.dox.h:201
const EncNone
no content transfer encoding (not recommended as SMTP servers break up long lines automatically)
Definition MailMessage.qm.dox.h:204
const Encodings
a list of all known content encoding schemes encodings
Definition MailMessage.qm.dox.h:213
the MailMessage namespace holds all public definitions in the MailMessage module
Definition MailMessage.qm.dox.h:126
Message info.
Definition MailMessage.qm.dox.h:146
*string body_encoding
The encoding used for the message body, if any.
Definition MailMessage.qm.dox.h:169
*string sender
The sender's email address.
Definition MailMessage.qm.dox.h:151
*string from
The From: address.
Definition MailMessage.qm.dox.h:148
*list< string > cc
Any CC: addresses.
Definition MailMessage.qm.dox.h:160
*bool important
The important flag.
Definition MailMessage.qm.dox.h:178
*bool read_receipt
The read receipt flag.
Definition MailMessage.qm.dox.h:184
*list< string > to
Any To: addresses.
Definition MailMessage.qm.dox.h:157
*list< hash< PartInfo > > parts
Any message parts.
Definition MailMessage.qm.dox.h:190
*string subject
The message subject.
Definition MailMessage.qm.dox.h:154
*list< hash< PartInfo > > attachments
Any message attachments.
Definition MailMessage.qm.dox.h:187
*string body_content_type
The content type of the message body.
Definition MailMessage.qm.dox.h:172
*bool delivery_receipt
The delivery receipt flag.
Definition MailMessage.qm.dox.h:181
*data body
The message body, if any.
Definition MailMessage.qm.dox.h:166
*list< string > bcc
Any BCC: addresses.
Definition MailMessage.qm.dox.h:163
*hash< auto > headers
Any message headers.
Definition MailMessage.qm.dox.h:175
Message part info.
Definition MailMessage.qm.dox.h:128
string name
Part name.
Definition MailMessage.qm.dox.h:130
string mime
Part MIME type.
Definition MailMessage.qm.dox.h:133
string transfer_encoding
Part transfer encoding.
Definition MailMessage.qm.dox.h:142
*hash< auto > headers
Part headers, if any.
Definition MailMessage.qm.dox.h:139
data part_data
Part data.
Definition MailMessage.qm.dox.h:136