[Email_Compose] allows an email message to be composed. For most purposes the [Email_Send] tag itself provides enough email composition options, but the [Email_Compose] type can be used if more control is needed. Objects of this type are usually passed to [Email_Queue] or [Email_Immediate] for sending. [Email_Compose] accepts the same parameters as [Email_Send] including -To, -From, -Subject, -Cc, -Bcc, -Sender, -ReplyTo, etc. It accepts a -Body parameter to setup a default text part and an -HTML parameter to set up a default HTML part. The -ContentType, -CharacterSet, -TransferEncoding, -ContentDisposition, -ExtraMIMEHeaders, and -Attachments can also be specified. In addition, the type supports four member methods that allow individual parts to be added to the message. [Email_Compose->AddTextPart] adds a text part to the message (accepts the text to add or a -Path parameter referencing a file to add). [Email_Compose->AddHTMLPart] adds an HTML part to the message (accepts the text to add or a -Path parameter referencing a file to add). [Email_Compose->AddAttachemnt] adds an attachment to the message (accepts the text to add or a -Path parameter referencing a file to add as well as a name parameter that specifies the name of the included file). And, [Email_Compose->AddPart] adds a generic part to the message (accepts the data of the part and a name for the part). The type also supports four member methods that are used by the [Email_Queue] or [Email_Immediate] methods. These include [Email_Compose->Recipients], [Email_Compose->Data], [Email_Compose->From], and [Email_Compose->Summary]. These methods are not usually called directly.
var(msg) = email_compose(...) email_immediate(-data=$msg->data, -from=$msg->from, -recipients=$msg->recipients)
email_compose->oncreate(-to = ?, -FROM = ?, -cc = ?, -bcc = ?, -subject = ?, -sender = ?, -replyto = ?, -body = ?, -html = ?, -date = ?, -contentType = ?, -characterset = ?, -transferencoding = ?, -contentdisposition = ?, -headertype = ?, -extramimeheaders = ?, -attachments = ?, -attachment = ?, -htmlimages = ?, -parts = ?)
email_compose->addtextpart(-data = ?, -path = ?)
email_compose->addhtmlpart(-data = ?, -path = ?, -images = ?)
email_compose->addattachment(-data = ?, -name = ?, -path = ?, -type = ?)
email_compose->addpart(-data = ?)
email_compose->data(-prefix::boolean = ?, -force::boolean = ?)
The code below will create a message with two different text parts and then queue it up to be sent.
var(my_msg) = email_compose(-to='[email protected]', -from='[email protected]', -subject='Re: Subj', -body='Good Deal') $my_msg->addTextPart(-data='additional part') email_queue(-host='smtp.example.com', -data=$my_msg->data, -from=$my_msg->from, -recipients=$my_msg->recipients)
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.