diff --git a/docs/user/mail/Mass Mailing Tips/How to Send Customized E-mail.txt b/docs/user/mail/Mass Mailing Tips/How to Send Customized E-mail.txt new file mode 100644 index 0000000000..040461c24b --- /dev/null +++ b/docs/user/mail/Mass Mailing Tips/How to Send Customized E-mail.txt @@ -0,0 +1,207 @@ +How to Send Customized E-Mail + +So you wish to send out customized e-mail to many people? Please reconsider +doing that, if it is unwanted spam. Still want to do it? Here's one way of +doing it: + +Save your message text in a file named "TemplateLetter.txt". It should look +something like this (I didn't word wrap the paragraphs, leaving each as one +long line, because the length would change depending on the inserted text +length): + +Hi there NAME, how are you today? + +I'm sending this message to EMAIL to inform you about a good deal for your company, COMPANY. + +Hope you like it. + +- Alex + + +Then save this following text as a script file, call it "MailToTemplate": + +#!/bin/sh + +# Make a mail merge letter by combining data from a given people file and a +# template letter text file. +# $Revision: 1.2 $ +# Some code from Scot Hacker's PeoplePorter http://www.bebits.com/app/1747 + +PeopleFile=$1 +echo "Mail merging using people file: $PeopleFile" + +Name=$(catattr META:name "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) +EMail=$(catattr META:email "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) +Company=$(catattr META:company "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) + +sed "s/NAME/$Name/g" /tmp/stage1 +sed "s/EMAIL/$EMail/g" /tmp/stage2 +sed "s/COMPANY/$Company/g" /tmp/stage3 +mail -v -s "Test Message to $Name" "$EMail" MailToTemplate /boot/home/people/Test\ Person +Mail merging using people file: /boot/home/people/Test Person +EOT +sent successfully! + + +And the result will be an e-mail like this: + +Subject: Test Message to Mr. Test A. Person +To: test@be.com +Date: Fri, 13 Jun 2003 12:13:29 -0400 EDT +Mime-Version: 1.0 +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Hi there Mr. Test A. Person, how are you today=3F + +I'm sending this message to test@be.com to inform you about a good deal for your company, Masters of Scripting, Inc.. + +Hope you like it. + +- Alex + + +If you want to use the BeOS attribute indices system to select people, you can +run the results of a query though the mail customizing script like this example +(watch out - very long line) which sends the e-mail to all people (presumably +the people files are on the /boot disk volume, which is why the -v is needed) +with "test" in their groups listing: + +Fri Jun 13 12:24:14 78 /Programming/bemaildaemon/documentation/Mass Mailing>query -v /boot META:group=*test* | sed "s/^/MailToTemplate /g" >/tmp/BatchMailCommands ; source /tmp/BatchMailCommands +Mail merging using people file: /boot/home/people/Test Person +EOT +sent successfully! +Mail merging using people file: /boot/home/people/Another Test +EOT +sent successfully! + + +Just so you know how it works, here is the batch commands file which was +automatically generated and used in the previous step: + +Fri Jun 13 12:24:20 79 /Programming/bemaildaemon/documentation/Mass Mailing>cat /tmp/BatchMailCommands +MailToTemplate /boot/home/people/Test\ Person +MailToTemplate /boot/home/people/Another\ Test + + +Finally, if you want to do fancier messages, like HTML mixed ones, you have to +also specify the headers. Since the usual "mail" program doesn't let you do +that, you have to prepare the entire message and use the attribute system to +tag it for mailing. Look at an existing message in your out box to see the +attributes needed. + +Prepare the message elsewhere (use some other e-mail package which lets you +insert HTML and pictures) then mail it to yourself, open the resulting file in +BeIDE (it takes care of the CRLF end of line conversion problems automatically, +you want this template file to have CRLF line ends, the earlier example doesn't +use them) and edit it to make it into a new message like this one: + + +To: "NAME" +From: "Imaginary Test Account" +Subject: Hi there NAME +Mime-Version: 1.0 +Content-Type: multipart/related; + type="multipart/alternative"; + boundary="----=_NextPart_000_0009_01C331AA.016FA080" + +This is a multi-part message in MIME format. + +------=_NextPart_000_0009_01C331AA.016FA080 +Content-Type: multipart/alternative; + boundary="----=_NextPart_001_000A_01C331AA.016FA080" + + +------=_NextPart_001_000A_01C331AA.016FA080 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Hi NAME, this is a reminder that you shouldn't annoy people with [No Spam Icon] spam! + +-------------------------------------------------------------------------------- + +Fine print: Even if it is customised and otherwise pretty. +------=_NextPart_001_000A_01C331AA.016FA080 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +This is your Spam! + +

Hi NAME, this is a reminder that you +shouldn't annoy people with +3D"[No spam! +


+

Fine print: Even if it is customised and otherwise +pretty. + + +------=_NextPart_001_000A_01C331AA.016FA080-- + +------=_NextPart_000_0009_01C331AA.016FA080 +Content-Type: image/png; + name="NoSpamIcon.png" +Content-Transfer-Encoding: base64 +Content-ID: <000801c331cb$88136380$42ae10ac@be.com> + +iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABTElEQVR42r2XDQ6DMAhGuVPvtHP0 +GN5ph2KpqY5QoF/xx4Rs2UzfAysKMXAQUSqgtREwJwMRoQhuLVon4YksCVAAnh2eiCdBMzgKRkQs +CZrBrxwEVILehFsS9BbcuxyDwGPwvi8GgTuzj+BaQPQJ/J6ddUcLrjtjvSpwLrZ9mL/bHmHm7bwe +pPbCIGDepzqLDm1RgswlmEv5f4oqhAIW8IyefQjv553VavAeoYALFiUP4fJ8HYiABhfx2/F9mrkU +VnC5D3wBla1cFMo8KP9yBaDdLs4pcgMem2+pAn2xomQ8eAGvu9UL4AqEZQ+gGqw74v6f2aOR3Q5A +rb4yNKJIAG4yQbbLArzQ21ffgk2OZ8Y3vyO4j2PP7km4KeBJPAk334prYrjIwt25oCanHPkUTb2W +zyQYmQcXpyPKTDmZGTE1nGqR+uZweseojhw/XAq+WQDwT5wAAAAASUVORK5CYII= + +------=_NextPart_000_0009_01C331AA.016FA080-- + + +Then in the mailing script, rather than calling "mail" to do the job, you have +to add attributes to the final file. Some you can clone from another outgoing +mail (like the chain), others you need to set to specify the recipient. Here's +the current full set: + + Type Size Name +---------- --------- ------------------------------- + MIME str 13 BEOS:TYPE + Text 46 MAIL:recipients + Text 43 MAIL:to + Text 1 MAIL:cc + Text 42 MAIL:subject + Text 1 MAIL:reply + Text 46 MAIL:from + Text 4 MAIL:mime + Text 18 MAIL:account +0x54494d45 4 MAIL:when + Int-32 4 MAIL:flags + Int-32 4 MAIL:chain + Text 5 MAIL:status + +You need at the minimum: +BEOS:TYPE set to: text/x-email +MAIL:recipients lists the address you are sending to, for example: +MAIL:from lists your return address: "Imaginary Test Account" +MAIL:chain set to your outgoing mail chain number, happens to be 1 here. +MAIL:flags set to 5. + +The commands to do that look like: +addattr -t string BEOS:TYPE text/x-email /tmp/stage3 +addattr -t string MAIL:recipients "<$EMail>" /tmp/stage3 +addattr -t string MAIL:from "\"Imaginary Test Account\" " /tmp/stage3 +addattr -t int MAIL:chain 1 /tmp/stage3 +addattr -t int MAIL:flags 5 /tmp/stage3 + +Then move the message to the /boot/home/mail/out folder, using a unique name, +since there has to be one file for each person. A suitable command might be: +mv /tmp/stage3 "/boot/home/mail/out/MessageTo$EMail" + +Finally, tell the daemon to check for mail. Right click on the mailbox icon in +the deskbar and pick "check for mail". It will then send all the pending mail. diff --git a/docs/user/mail/Mass Mailing Tips/MailToTemplate b/docs/user/mail/Mass Mailing Tips/MailToTemplate new file mode 100644 index 0000000000..753e95ffe9 --- /dev/null +++ b/docs/user/mail/Mass Mailing Tips/MailToTemplate @@ -0,0 +1,18 @@ +#!/bin/sh + +# Make a mail merge letter by combining data from a given people file and a +# template letter text file. +# $Revision: 1.1 $ +# Some code from Scot Hacker's PeoplePorter http://www.bebits.com/app/1747 + +PeopleFile=$1 +echo "Mail merging using people file: $PeopleFile" + +Name=$(catattr META:name "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) +EMail=$(catattr META:email "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) +Company=$(catattr META:company "$PeopleFile" | sed s/\ \:\ /%/g | cut -f3 -d\%) + +sed "s/NAME/$Name/g" /tmp/stage1 +sed "s/EMAIL/$EMail/g" /tmp/stage2 +sed "s/COMPANY/$Company/g" /tmp/stage3 +mail -v -s "Test Message to $Name" "$EMail" /tmp/PeopleListTemp + +cat /tmp/PeopleListTemp | while read LINE; do + NULLATTR="${LINE#* : string :}" + if [ "x$NULLATTR" = "x" ]; then + echo "WARNING: no email address in $LINE" + continue + fi + PPLFILE="${LINE% : string : *}" + PPL="${PPLFILE##*/}" + THEMAIL="${LINE##* : string : }" + FILTERED="$(echo "$THEMAIL" | sed 's/[A-Za-z0-9.+_-]*\@[A-Za-z0-9._-]*/GOOD/' )" + echo "[$PPL] [$THEMAIL] $FILTERED" + if [ "x$FILTERED" != "xGOOD" ]; then + echo "WARNING: strange email for '$PPL': <$THEMAIL>" + fi +done + +sed 's/ $/<--Blanks at the end of the e-mail, BAD!/' /tmp/PeopleListOut +sed 's/: string :<--Blanks at the end/No e-mail/' /tmp/PeopleListBlanked +grep "Blanks at the end" /tmp/PeopleListBlanked diff --git a/docs/user/mail/Preferences Panel/Network06_EmailPrefs.html b/docs/user/mail/Preferences Panel/Network06_EmailPrefs.html new file mode 100644 index 0000000000..1b371d8b84 --- /dev/null +++ b/docs/user/mail/Preferences Panel/Network06_EmailPrefs.html @@ -0,0 +1,283 @@ + + + +Networking : E-mail Preferences + + + + +

+Networking +

+

+

+E-mail Preferences + +

+

+
+
+
+

+You set up your e-mail environment in the E-mail +preferences. To launch E-mail, +click on the Be logo, open the Preferences +item, and click on E-mail +:

+

+ 

+ + + +

+ When you launch E-mail, +this is what you see:

+ + + +

+When you get to this section, select Add to make a new e-mail account

+ +
+
+
+

+Account Info

+ + + +

+You must select the format Inbound and Outbound from the Account type menu before preceeding + +

+

+ +Account Name Whatever you wish your e-mail account to be called.

+

+ +Real Name Your name.

+

+ +Return Adress Your return e-mail adress

+

+
+
+
+ +

+POP3/IMAP +This lets you set your e-mail type. It is probably POP +

+

+
User Name. +Your User name is usually the first part of your e-mail address-- it's the "user" in "user@company.com". +

+

+Password. +If you don't enter a password, you're asked for one whenever you make a mail connection.

+

+POP host +This is the Internet domain names or IP addresse of the servers that handle your incoming mail. If this is not set, you will not be able to receive incoming mail.

+

+Authenticiation Method (POP Only) +This is the method of security your mail provider uses. Its probably plain text, but they can tell you if its not.

+

+Folder (IMAP Only) +This lets you specify the IMAP folder you are using on the server. Its probably INBOX

+

+Leave Mail On Server +This option leaves your e-mail on the server, so it can be downloaded again later.

+

+Delete Mail From Server when Deleted Locally +This option works with the previous one. It removes mail from the server when you delete it on your own machine

+

+New Mail Notification Method +Lets you select which method is used to alert you to a new e-mail arriving

+

+Inbox Destination Folder +Lets you specify your inbox. You should leave it at /boot/home/mail/in, and you must not place it off /boot, especially not off a BeOS partition.

+
+
+
+

+Outgoing

+ +

+Source Folder +The folder from which mails to be sent are taken. You should not change this.

+

+SMTP Host +The outgoing server of your e-mail provider. If this is not set, this account cannot send e-mails.

+

+User Name +Your SMTP user name. Usually not nessacery, usually greyed out

+

+Password +Your SMTP password. Usually not nessacery, usually greyed out

+

+Authenticiation Method +This is where you select your authenticiation method. There is: None (most common), ESMTP (encrypted, rare), and POP3 Before SMTP (slightly more common than ESMTP). The second one needs the password box filled in + +
+


+
+

+Retrieval Frequency

+ + + +

+These menus let you set how often the system should check for incoming mail, and send new outgoing messages. During the check, new incoming messages are downloaded from the POP host to your computer, and outgoing messages are uploaded from your computer to the SMTP host. +

+ + + + + +
+ + + +If you connect to your network through Dial-up Networking, +checking mail may automatically start a PPP connection, unless you check "Only when PPP is active" +
+ + +
+
+
+

+Mail Notification

+ + + +

+Check Show status window +to put a Mail Status +window on your desktop (shown below). +

+

+Window Look. +Changes the appearance of the Status window

+

+Window Visible On. +Selects which workspaces to show the Window on

+

+The Mail Status +This window shows you what the Mail Daemon is doing right now. When downloading or uploading mail, it gives you an e-mail count and a kilobyte size count. +

+ + + +
+
+
+

+Misc

+

+Auto-start the Mail_Daemon. If this is not ticked, you should tick it now. It loads the mail_daemon at boot, and launches the deskbar icon for the Daemon.

+
+
+
+

+All Done

+

+When you finish configuring mail preferences, click Save +in the E-mail window. +Click Check Now +to check for new messages immediately.

+ + +
+
+
+

+Mailboxes

+

+The BeOS defines the /boot/home/mail +directory as the repository for mail. Incoming mail messages are placed in /boot/home/mail/in. +Messages that you send are placed in /boot/home/mail/out. +If you create your own "mailbox" folders--into which you sort your incoming mail, for example--you're encouraged to place them in /boot/home/mail +alongside the folders that Be creates.

+ + + + + +
+ + + +The mail folders aren't created until you receive or send mail. +
+

+The easiest way to open one of the mailbox folders is to pop up the mailbox icon's context menu (in Deskbar's Status View). + +

+ + + +

+Open Inbox +opens the incoming mail folder in a Tracker +window.

+

+Open Mail Folder +opens the /boot/home/mail +folder.

+

+Any Tracker folder window that contains an e-mail message is automatically given extra e-mail attributes that you can see when you put the window in List View +mode.

+ + + +

+The Status +of an e-mail message is either New +or Read +(for in-coming messages), or Pending +or Sent +(for out-going). The Priority +attribute is provided as a convenience--you can set an e-mail's priority to whatever you want. The values of the rest of the e-mail attributes are taken from the message itself.

+ + +

+Sending and Receiving Mail Messages

+

+There are a number of ways to check for new mail:

+
  • +Wait for the system to perform its automated check.
  • +
  • +Press Check Now +in the Mail Status +window.
  • +
  • +Choose Check Now +from the mailbox context menu in Deskbar's Status View. +
  • +

    +Each of these methods also sends any Pending +out-going mail (messages that you've written but haven't yet sent).

    + + + + + +

    +


    + +

    + +

    + +
    +

    + +
    + COPYRIGHT © 2000 Be, INC. ALL RIGHTS RESERVED. Enhanced 2003 by Cian Duffy for the Mail Daemon Replacement Team +

    +
    +
    + + + diff --git a/docs/user/mail/Preferences Panel/art/EmailPref.gif b/docs/user/mail/Preferences Panel/art/EmailPref.gif new file mode 100644 index 0000000000..41da5eec71 Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/EmailPref.gif differ diff --git a/docs/user/mail/Preferences Panel/art/Outgoing.png b/docs/user/mail/Preferences Panel/art/Outgoing.png new file mode 100644 index 0000000000..28783aaa9f Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/Outgoing.png differ diff --git a/docs/user/mail/Preferences Panel/art/activestatus.png b/docs/user/mail/Preferences Panel/art/activestatus.png new file mode 100644 index 0000000000..86202db75b Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/activestatus.png differ diff --git a/docs/user/mail/Preferences Panel/art/emailAttrs.gif b/docs/user/mail/Preferences Panel/art/emailAttrs.gif new file mode 100644 index 0000000000..1e018225b9 Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/emailAttrs.gif differ diff --git a/docs/user/mail/Preferences Panel/art/incoming.png b/docs/user/mail/Preferences Panel/art/incoming.png new file mode 100644 index 0000000000..bb5b11df1d Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/incoming.png differ diff --git a/docs/user/mail/Preferences Panel/art/mailPopup.gif b/docs/user/mail/Preferences Panel/art/mailPopup.gif new file mode 100644 index 0000000000..26aaae42a6 Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/mailPopup.gif differ diff --git a/docs/user/mail/Preferences Panel/art/main.png b/docs/user/mail/Preferences Panel/art/main.png new file mode 100644 index 0000000000..fd23ef1b2a Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/main.png differ diff --git a/docs/user/mail/Preferences Panel/art/new.png b/docs/user/mail/Preferences Panel/art/new.png new file mode 100644 index 0000000000..2f5125c01f Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/new.png differ diff --git a/docs/user/mail/Preferences Panel/art/retrieval.png b/docs/user/mail/Preferences Panel/art/retrieval.png new file mode 100644 index 0000000000..aed4f20cf2 Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/retrieval.png differ diff --git a/docs/user/mail/Preferences Panel/art/status.png b/docs/user/mail/Preferences Panel/art/status.png new file mode 100644 index 0000000000..852fb99402 Binary files /dev/null and b/docs/user/mail/Preferences Panel/art/status.png differ diff --git a/docs/user/mail/Programming Notes/ChainRunner Overview.txt b/docs/user/mail/Programming Notes/ChainRunner Overview.txt new file mode 100644 index 0000000000..ed650f9f0a --- /dev/null +++ b/docs/user/mail/Programming Notes/ChainRunner Overview.txt @@ -0,0 +1,24 @@ +NathanW wrote on June 30 2003: + +Here's the overview: + +ChainRunner: + It's now a BLooper and it goes like this: Running the chain +triggers an 'INIT' message, which causes it to begin to load add-ons. +The constructor of the producer add-on calls ChainRunner's +GetMessages() routine with a list of unique ids to fetch. It then runs +through the list, passing in those, then calls any registered process +callbacks after the list is exhausted. Note that finishing the list * +does not* cause the connection to be terminated and the add-ons to be +destructed. Single pass add-ons (e.g. POP and Outbox) register a +process callback that calls ChainRunner::Stop(). + +MailProtocol/MailFilter: + No longer sets the unique id, because it's passed in. Calls +GetMessages(), and uses ReportProgress() and ShowError() methods of +ChainRunner instead of using the functions in status.h. Also sets SIZE +attribute in out_headers that contains the final downloaded size of the +message. Also now passed a ChainRunner instead of a StatusView. + +That's about it, really. +-Nathan diff --git a/docs/user/mail/Programming Notes/Writing Add-ons.zip b/docs/user/mail/Programming Notes/Writing Add-ons.zip new file mode 100644 index 0000000000..d6e01fadfc Binary files /dev/null and b/docs/user/mail/Programming Notes/Writing Add-ons.zip differ diff --git a/docs/user/mail/Public API/MIMEMultipartContainer.html b/docs/user/mail/Public API/MIMEMultipartContainer.html new file mode 100644 index 0000000000..a9a6a6e857 --- /dev/null +++ b/docs/user/mail/Public API/MIMEMultipartContainer.html @@ -0,0 +1,668 @@ + + + MIMEMultipartContainer + + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    + +
    + +
    + +

    + +

    MIMEMultipartContainer

    + +
    Derived + from: MailComponent
    + Declared in:  + include/public/MailContainer.h
    + Library: libmail.so
    + +


    +

    + +

    MIMEMultipartContainer uses the RFC 2046 multipart specification to allow you to place + multiple components in a single message. Mostly useful for attachments and things.

    + +

    + +


    + +

    + +

    Constructor +and +Destructor

    + +

    + +


    + + + + + + +
    +

    +
    +

    MIMEMultipartContainer() +

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    + MIMEMultipartContainer( + const char *boundary = NULL, + const char *this_is_an_MIME_message_text = NULL + )

    +
    +

    +
    + +

    Initializes the MIMEMultipartContainer. Sets the boundary between parts to boundary. + Note that boundary can be an arbitrary text string but must contain only US-ASCII + characters and be unique to this particular MIMEMultipartContainer. It does not have to be globally unique, however. boundary must be specified, + either here or through SetBoundary(). Also, sets the warning text about "This is an MIME message..." to this_is_an_MIME_message_text, + which need not be specified at all.

    + +
    + +

    + +


    + + + + + + +
    +

    +
    +

    ~MIMEMultipartContainer() +

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual + ~MIMEMultipartContainer()

    +
    +

    +
    + +

    Destroys the MIMEMultipartContainer. Note that this deletes all components which may have been added to + this object. The ownership of all components is assumed by MIMEMultipartContainer when they are added.

    + +

    + +


    + +

    + +

    Member +Functions

    + +

    + +


    + + + + + + +
    +

    +
    +

    GetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + GetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Returns an error. MIMEMultipartComponents don't have data of their own..

    + +

    Return Value:

    + +
    - B_BAD_TYPE This operation is guranteed to fail.
    + +

    + +


    + + + + + + +
    +

    +
    +

    SetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + SetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Returns an error. MIMEMultipartComponents don't have data of their own..

    + +

    Return Value:

    + +
    - B_BAD_TYPE This operation is guranteed to fail.
    + +

    + +


    + + + + + + +
    +

    +
    +

    Instantiate ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Instantiate(BPositionIO + *data, + size_t length)

    +
    +

    +
    + +

    Does what you would expect. Creates a list of components from data. Note that you cannot delete data, as we cache + it for later. This is because, as a memory and CPU saving measure, we do not actually instantiate these components until asked to. Thus instantiating an MIMEMultipartContainer is not a + processor or memory-intensive operation.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_BAD_TYPE if data is not an MIME multipart component

    +
    + +

    + +


    + + + + + + +
    +

    +
    +

    Render ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Render(BPositionIO + *data)

    +
    +

    +
    + +

    Renders the component into RFC 822 format and places the result + in data, + starting at data + ->Position().

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - Something else in the event of failure.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetBoundary()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + SetBoundary( + const char *boundary + )

    +
    +

    +
    + +

    Sets the boundary between parts to boundary. + Note that boundary can be an arbitrary text string but must contain only US-ASCII + characters and be unique to this particular MIMEMultipartContainer. It does not have to be globally unique, however.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetThisIsAnMIMEMessageText()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + SetThisIsAnMIMEMessageText( + const char *text + )

    +
    +

    +
    + +

    Sets the warning text about "This is an MIME message..." to text, + which need not be specified at all. We reccomend that it only be set in the top-most MIMEMultipartContainer of the message.

    + +

    + +


    + + + + + + +
    +

    +
    +

    AddComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + void AddComponent( + MailComponent *component + )

    +
    +

    +
    + +

    Adds component to this MIMEMultipartContainer. Note that the MIMEMultipartContainer + assumes ownership of component. Thus, you may not delete component. + If you continue to modify to it after calling AddComponent(), your changes will be reflected when you + call Render().

    + +

    + +


    + + + + + + +
    +

    +
    +

    GetComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + MailComponent * GetComponent( + int32 index + )

    +
    +

    +
    + +

    Returns the component at index. + Instantiate()s it if it has not yet been instantiated. Otherwise, returns already instantiated + component. Use RTTI or MailComponent hooks to do useful things with the returned + component.

    + +

     

    + +

    + +
    + + + + + + +
    +

    +
    +

    CountComponents()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + int32 CountComponents() const

    +
    +

    +
    + +

    Returns the total number of components in this MIMEMultipartContainer.

    + +

     

    + +

    + + +


    + + + + + + +
    +

    +
    +

    ManualGetComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + status_t ManualGetComponent( + MailComponent * component, + int32 index + )

    +
    +

    +
    + +

    Attempts to Instantiate() component from the component at + index. Note that this will fail either if component->Instantiate() fails + or if the component at index either does not exist or exists only as a MailComponent and not as a raw buffer. In other words, + this function will succeed if and only if the component at index exists, was part of the message + when this MIMEMultipartContainer was instantiated and has not been written over since then, and component->Instantiate() succeeds on this buffer. + component must be a valid MailComponent.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_BAD_INDEX if index is out of range

    +

    - B_NAME_IN_USE if the component at index does not exist in raw buffer form

    + +

    - Something else if component->Instantiate() fails.

    +
    + +
    +

    + +


    + + + + + + +
    +

    +
    +

    RemoveComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + status_t RemoveComponent( + int32 index + )

    +
    +

    +
    + +

    Removes the component at index from the container and + frees all memory associated with it (i.e. we delete it).

    + +

    Return Value:

    + +
    - B_OK if everything succeeds.

    + + - B_BAD_INDEX if index is out of range

    +
    + +
    + +

    + +

    + +


    + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    +
    + +


    +

    + +
    Mail Daemon 2 API +Documentation + +

    ©2001 Dr. Zoidberg +Enterprises

    + + diff --git a/docs/user/mail/Public API/MailComponent.html b/docs/user/mail/Public API/MailComponent.html new file mode 100644 index 0000000000..70a897e093 --- /dev/null +++ b/docs/user/mail/Public API/MailComponent.html @@ -0,0 +1,763 @@ + + + MailComponent + + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    + +
    + +
    + +

    + +

    MailComponent

    + +
    Derived + from: none
    + Declared in:  + include/public/MailComponent.h
    + Library: libmail.so
    + +


    +

    + +

    MailComponent is the base class for the vast majority of the + public Mail Kit. It is, however, important to remember that + MailComponent is not abstract, and is useful by itself. A + MailComponent has the important quality of being able to read the + headers of a message or component without instantiating whatever + massive quantity of data might lie therein. This is useful + primarily to determine the kind of data you are dealing with, so + that the user can make a decision as to whether it should be + shown.

    + +

    + +


    + +

    + +

    Constructor +and +Destructor

    + +

    + +


    + + + + + + +
    +

    +
    +

    MailComponent() +

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    MailComponent()

    +
    +

    +
    + +

    Initializes the MailComponent and does nothing else.

    + +

     

    + +

    + +


    + + + + + + +
    +

    +
    +

    ~MailComponent() +

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual + ~MailComponent()

    +
    +

    +
    + +

    Destroys the MailComponent. Does nothing of interest.

    + +

    + +


    + +

    + +

    Hook +Functions

    + +

    + +


    + + + + + + +
    +

    +
    +

    GetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + GetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Retrieves the data contained in this component in canonical + format and places this data in + data. The various attachments subclasses implement this + function to return decoded data, and PlainTextBodyComponent + returns UTF8 text. MailComponent implements this function to do + nothing and return B_OK.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - Something else in the event of failure.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + SetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Sets the content of this component to the canonical format data + contained in data. + Thus, an attachment subclass would accept a file here and encode + it into the specified encoding. MailComponent implements this + function to do nothing and return B_OK.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - Something else in the event of failure.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Instantiate ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Instantiate(BPositionIO + *data, + size_t length)

    +
    +

    +
    + +

    Initializes this component to the RFC 822 format data in + data, + starting at data + ->Position(), for up to length + bytes. Note that if you implement this function, your + subclass may have taken up some of your data. As such, cache the + position of data + before calling your parent's version of + Instantiate(), and then + subtract the difference between the new position and your cached + value, like this:

    + +
    off_t cache = data->Position();
    + MailComponent::Instantiate(data,length);
    + length -= (data->Position() - cache);
    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_BAD_TYPE if we cannot handle data.

    + +

    - Something else in the event of another kind of + failure.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Render ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Render(BPositionIO + *data)

    +
    +

    +
    + +

    Renders the component into RFC 822 format and places the result + in data, + starting at data + ->Position().

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - Something else in the event of failure.

    + +

    + +


    + + + + + + +
    +

    +
    +

    MIMEType ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + MIMEType(BMimeType + *mime)

    +
    +

    +
    + +

    Places the MIME type of the data into mime.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - Something else in the event of failure.

    + +

    + +


    + +

    + +

    Member +Functions

    + +

    + +


    + + + + + + +
    +

    +
    +

    WhatIsThis()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    MailComponent* + WhatIsThis()

    +
    +

    +
    + +

    Employs simple heuristics such as the MIME type to present you + with an instance of a useful subclass of MailComponent. You can + then use any of MailComponent's hook functions or RTTI calls to + get more information. Bear in mind that the returned component is + not set to any data. You must still Instantiate() + it from whatever data this object was instantiated from.

    + +

    + +


    + + + + + + +
    +

    +
    +

    IsAttachment()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    bool + IsAttachment()

    +
    +

    +
    + +

    Employs simple heuristics such as the MIME type and the + Content-Disposition: header to determine whether this component is + an attachment. Returns true if it is an attachment, + false if not.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetHeaderField()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + + + + +
    +

    void + SetHeaderField( + +

    + const char *key,
    + const char *value,
    + uint32 charset = B_ISO1_CONVERSION,
    + mail_encoding encoding = quoted_printable,
    + bool replace_existing= true + + )

    +
    +

    void + SetHeaderField( + +

    + const char *key,
    + BMessage *structured_header,
    + bool replace_existing= true + + )

    +
    +

    +
    + +

    Adds the specificed header of type key + and with the UTF8 contents value + to the component. + SetHeaderField() converts + any 8 bit data in value + to charset + (see the Support Kit on UTF8 for more information on this), and + encodes it into 7 bit data using encoding. + + If replace_existing + is true, replaces any existing header of this type with this one, + otherwise adds a second one.

    +

    Thus, to set the header To: of some MailComponent component to foo@bar.com, we would do this:

    +
    + component->SetHeaderField("To","foo@bar.com"); +
    +

    The version of the function that takes a BMessage sets a structured header. These are in the format + unlabeled; key=value; key=value. The most common instance of this is the Content-Type header, + where the MIME type is unlabeled, and various other information, such as character set, is specified in the + key/value pairs. The format for structured_header is relatively + simple: simply use BMessage::AddString(key,value) for each key/value pair. The only exception to this + rule is the unlabeled data. For this, simply use the key unlabeled. Please note that the charset and encoding arguments + defined for the text version of SetHeaderField is not provided here because structured headers cannot be encoded.

    +

    Thus, a relatively standard Content-Type header would be specified as follows: +

    + BMessage structured;
    + structured.AddString("unlabeled","text/plain");
    + structured.AddString("charset","iso-8859-1");
    + component->SetHeaderField("To",&structured); +
    +
    + +

    + +


    + + + + + + +
    +

    +
    +

    HeaderField()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + + + + +
    +

    const char * + HeaderField(const + char *key, + int32 index + = + 0)

    +
    +

    status_t + HeaderField( +

    + const char *key,
    + BMessage *structured_header,
    + int32 index = 0 + + )

    +
    +

    +
    + +

    Returns the header key. + If there is more than one header key, + use index to + iterate through them. In the event that the specified header does + not exist, HeaderField() + returns NULL. Thus, to retrieve the contents of the Subject: field in + UTF8 format, you would do this:

    +
    + const char *subject = component->HeaderField("Subject"); +
    +

    The version of this function that takes a BMessage + decodes whatever structured header may exist in key + and places it in structured_header according to the + format laid out in SetHeaderField(). Returns B_NAME_NOT_FOUND + if the header key does not exist. If it does exist, + but is not structured, no error is returned; the entire contents of the header are placed in unlabeled. +

    + +

     

    + + + +

    + +


    + + + + + + +
    +

    +
    +

    HeaderAt()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    const char * + HeaderAt( + int32 index)

    +
    +

    +
    + +

    Returns the key of the header at index. + Useful for iterating through all the headers. If index + is out of range, HeaderAt() returns NULL.

    + +

     

    + +

    + + + +

    + +


    + + + + + + +
    +

    +
    +

    RemoveHeader()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    const char * + RemoveHeader( + const char *key)

    +
    +

    +
    + +

    Removes all headers with the key key.

    + +

     

    + +

    + +


    + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    +
    + +


    +

    + +
    Mail Daemon 2 API +Documentation + +

    ©2001 Dr. Zoidberg +Enterprises

    + + diff --git a/docs/user/mail/Public API/MailMessage.html b/docs/user/mail/Public API/MailMessage.html new file mode 100644 index 0000000000..85e0f41a96 --- /dev/null +++ b/docs/user/mail/Public API/MailMessage.html @@ -0,0 +1,950 @@ + + + MailMessage + + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    + +
    + +
    + +

    + +

    MailMessage

    + +
    Derived + from: MailComponent
    + Declared in:  + include/public/MailMessage.h
    + Library: libmail.so
    + +


    +

    + +

    MailMessage is what you use if you are interested in actually + sending messages. It allows you to add an arbitrary number of + components (naturally making it multipart only if there is more + than one), and provides many convenience functions for adding, modifying + and accessing both headers and data. If you use this kit, you will get to + know MailMessage very well.

    + +

    + +


    + +

    + +

    Constructor +and +Destructor

    + +

    + +


    + + + + + + +
    +

    +
    +

    MailMessage()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    MailMessage( + BPositionIO *mail_file = NULL + )

    +
    +

    +
    + +

    Creates a new MailMessage. If mail_file is not NULL, + the MailMessage will be instantiated to the RFC 822 format data contained + in mail_file.

    + +

     

    + +

    + +


    + + + + + + +
    +

    +
    +

    ~MailMessage()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual + ~MailMessage()

    +
    +

    +
    + +

    Destroys the message, frees internal buffers, and deletes all added + components.

    + +

    + +


    + +

    + +

    Member +Functions

    + +

    + +


    + + + + + + + + + + + + +
    +

    +
    +

    To (), From (), ReplyTo (), CC (), Subject (), Priority ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + + + + + + + + + + + + + + + + +
    +

    const char * + To()

    +
    +

    const char * + From()

    +
    +

    const char * + ReplyTo()

    +
    +

    const char * + CC()

    +
    +

    const char * + Subject()

    +
    +

    int + Priority()

    +
    +

    +
    + +

    Returns the relevant header field from the message. These are simply a convenience. Subject(), + for instance, is equivalent to, and implemented as, HeaderField("Subject"). There is + no BCC() function because, for obvious reasons, it is impossible to retrieve BCCs from the message.

    + +
    + +

    + +


    + + + + + + + + + + + + +
    +

    +
    +

    SetTo (), SetFrom (), SetReplyTo (), SetCC (), SetBCC (), SetSubject (), SetPriority ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + + + + + + + + + + + + + + + + + + + +
    +

    void + SetTo( + const char *to + )

    +
    +

    void + SetFrom( + const char *to + )

    +
    +

    void + SetReplyTo( + const char *to + )

    +
    +

    void + SetCC( + const char *to + )

    +
    +

    void + SetBCC( + const char *to + )

    +
    +

    void + SetSubject( + const char *to + )

    +
    +

    void + SetPriority( + int to + )

    +
    +

    +
    + +

    Returns the relevant header field of the message. With the exception of + SetBCC(), these are simply conveniences which can be easily emulated + with SetHeaderField().

    + +
    + +

    + +


    + + + + + + +
    +

    +
    +

    SendViaAccount ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + + + + +
    +

    void + SendViaAccount( + const char *account_name + )

    +
    +

    void + SendViaAccount( + int32 chain_id + )

    +
    +

    +
    + +

    Sets the message up so that it is sent via the account specified by either account_name + or chain_id, which of course must exist as an outbound chain (see + MailChain::ChainDirection() for details). Automatically calls SetFrom() with + the return address indicated in the specified chain using the format "Real Name" <e-mail>.

    + +
    +

    + +


    + + + + + + +
    +

    +
    +

    AddComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + void AddComponent( + MailComponent *component + )

    +
    +

    +
    + +

    Adds component to this MailMessage. Note that the MailMessage + assumes ownership of component. Thus, you may not delete component. + If you continue to modify to it after calling AddComponent(), your changes will be reflected when you + call Render(). AddComponent() automatically makes the message multipart if there is + more than one component.

    + +

    + +


    + + + + + + +
    +

    +
    +

    GetComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + MailComponent * GetComponent( + int32 index + )

    +
    +

    +
    + +

    Returns the component at index. + Instantiate()s it if it has not yet been instantiated. Otherwise, returns already instantiated + component. Use RTTI or MailComponent hooks to do useful things with the returned + component.

    + +

     

    + +

    + +
    + + + + + + +
    +

    +
    +

    CountComponents()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    + int32 CountComponents() const

    +
    +

    +
    + +

    Returns the total number of components in this MailMessage.

    + +

     

    + +

    + +


    + + + + + + +
    +

    +
    +

    Attach ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + Attach( + entry_ref *ref, + bool include_attributes = true + )

    +
    +

    +
    + +

    Attaches ref to this message. If include_attributes + is true, uses an AttributedMailAttachment + instead of a SimpleMailAttachment. Be aware that is + attached in the state it is in when the message is rendered, not when Attach() is + called.

    + +

    + +


    + + + + + + +
    +

    +
    +

    IsComponentAttachment ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    bool + IsComponentAttachment( + int32 index)

    +
    +

    +
    + +

    If the component at index is an attachment of any + kind, returns true, otherwise returns false.

    + +

    + + +


    + + + + + + +
    +

    +
    +

    SetBodyTextTo ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + SetBodyTextTo(const + char *text)

    +
    +

    +
    + +

    Sets the body of this message to the UTF8 string + contained in text. + If no body has been specified through SetBody(), + SetBodyTextTo() creates one.

    + +

    + +


    + + + + + + +
    +

    +
    +

    BodyText ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    const char * + BodyText()

    +
    +

    +
    + +

    Returns the contents of Body() as a UTF8 + string. Returns NULL if no body exists.

    + +

    +


    + + + + + + +
    +

    +
    +

    SetBody ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    status_t + SetBody( + PlainTextBodyComponent *body)

    +
    +

    +
    + +

    Sets the body of this message to body. + If a body has already been specified, SetBody() returns B_ERROR, otherwise + returns B_OK.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Body ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    PlainTextBodyComponent * + Body()

    +
    +

    +
    + +

    Returns the body as a PlainTextBodyComponent pointer. + Returns NULL if no body exists. This object belongs to the MailMessage, do not delete it.

    + +

    +


    + + + + + + +
    +

    +
    +

    Instantiate ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Instantiate(BPositionIO + *data, + size_t length)

    +
    +

    +
    + +

    Initializes this message to the RFC 822 format data in + data, + starting at data + ->Position(), for up to length + bytes.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_BAD_TYPE if data + does not seem to be an e-mail message.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Render ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Render(BPositionIO + *data)

    +
    +

    +
    + +

    Renders the message into RFC 822 format and places the result + in data, + starting at data + ->Position(). If data + is a BFile, writes appropriate attributes and sets its MIME type to text/x-email.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds.
    + +

    +

    + +


    + + + + + + +
    +

    +
    +

    RenderTo ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    status_t + RenderTo(BDirectory + *dir)

    +
    +

    +
    + +

    Creates a new file in dir, named according to + the following format: "Subject" <To> unique indentifier. Calls + Render() on the resulting file and writes appropriate attributes.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds.
    + +

    +

    + +


    + + + + + + +
    +

    +
    +

    Send ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    status_t + Send(bool + send_now)

    +
    +

    +
    + +

    Calls RenderTo() with the directory specified by the MailChain + passed to SendViaAccount(). If that is invalid, it uses the default outbound chain + given by MailSettings::DefaultOutboundChainID(). After + rendering the message, if send_now is true, + calls MailDaemon::SendQueuedMail().

    + +

    Return Value:

    + +
    - B_OK if everything succeeds.

    + - B_MAIL_NO_DAEMON if the mail daemon is not running.

    + - something else if there is another error.

    + +

    +

    + +


    + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    +
    + +


    +

    + +
    Mail Daemon 2 API +Documentation + +

    ©2001 Dr. Zoidberg +Enterprises

    + + diff --git a/docs/user/mail/Public API/PlainTextBodyComponent.html b/docs/user/mail/Public API/PlainTextBodyComponent.html new file mode 100644 index 0000000000..3c78c909cf --- /dev/null +++ b/docs/user/mail/Public API/PlainTextBodyComponent.html @@ -0,0 +1,614 @@ + + + PlainTextBodyComponent + + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    + +
    + +
    + +

    + +

    PlainTextBodyComponent

    + +
    Derived + from: MailComponent
    + Declared in:  + include/public/MailComponent.h
    + Library: libmail.so
    + +


    +

    + +

    PlainTextBodyComponent stores plain text. It uses UTF8 text as + its canonical format and reads and writes RFC 2047 style text. As + such, it handles accents and other 8 bit characters with ease. If + you want to send text, this is the way to go.

    + +

    + +


    + +

    + +

    Constructor +and +Destructor

    + +

    + +


    + + + + + + +
    +

    +
    +

    PlainTextBodyComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    PlainTextBodyComponent(const + char*text + = + NULL)

    +
    +

    +
    + +

    Initializes the component and sets its content to text, + which can be NULL. The argument is a UTF8 null-terminated string. + Encoding defaults to quoted printable with the ISO-8859-1 + charset.

    + +

     

    + +

    + +


    + + + + + + +
    +

    +
    +

    ~PlainTextBodyComponent()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual + ~PlainTextBodyComponent()

    +
    +

    +
    + +

    Destroys the component and frees internal buffers. Does nothing + of interest.

    + +

    + +


    + +

    + +

    Member +Functions

    + +

    + +


    + + + + + + +
    +

    +
    +

    GetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + GetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Retrieves the data contained in this component as a UTF8 string + and places the contents of this string in + data.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_ERROR if something goes wrong.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Text ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    const char * + Text()

    +
    +

    +
    + +

    Returns the contents of this component as a UTF8 + string.

    + +

    + +


    + + + + + + +
    +

    +
    +

    BStringText ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    BString * + BStringText()

    +
    +

    +
    + +

    Returns the internal UTF8 format BString used by this component. + As such, you can do raw text operations on the content of the message. The use of + this function is not reccomended.

    + +
    + +

    + +


    + + + + + + +
    +

    +
    +

    Quote ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + Quote( + const char *message = NULL, + const char *quote_style = "> " + )

    +
    +

    +
    + +

    Quotes the contents of this component. Inserts quote_style at the start of every line, + and prefaces the content with message, if it is not NULL. message + should be something like "On September 30, 2001, John Smith said:", or something in that vein. Note that the new line after message + is supplied for you, so you do not need to add it.

    + +
    +

    + +


    + + + + + + +
    +

    +
    +

    SetDecodedData ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + SetDecodedData(BPositionIO + *data)

    +
    +

    +
    + +

    Sets the contents of this component to the UTF8 format data + contained in data.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_ERROR if something goes wrong.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetText ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + SetText(const + char *text)

    +
    +

    +
    + +

    Sets the contents of this component to the UTF8 string + contained in text.

    + +

    + +


    + + + + + + +
    +

    +
    +

    AppendText ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + AppendText(const + char *text)

    +
    +

    +
    + +

    Appends text + to the current contents of this component. text + should be a UTF8 string.

    + +

    + +


    + + + + + + +
    +

    +
    +

    SetEncoding ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    void + SetEncoding(mail_encoding + encoding, + int32 charset)

    +
    +

    +
    + +

    Sets the encoding and charset used by Render() + to encoding + and charset, + respectively. Use the conversion constants from UTF8.h for + charset. We + strongly reccomend that you always use the defaults for the + reasons outlined in RFC + 2047.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Instantiate ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Instantiate(BPositionIO + *data, + size_t length)

    +
    +

    +
    + +

    Initializes this component to the RFC 822 format data in + data, + starting at data + ->Position(), for up to length + bytes. Handles encoded data according to RFC 2047

    + +

    Return Value:

    + +
    - B_OK if everything succeeds. + +

    - B_BAD_TYPE if data + does not seem to be plain text.

    + +

    + +


    + + + + + + +
    +

    +
    +

    Render ()

    +
    +

    + +

     

    + +
    + + + +
    +

    + + + +
    +

    virtual status_t + Render(BPositionIO + *data)

    +
    +

    +
    + +

    Renders the component into RFC 822 format and places the result + in data, + starting at data + ->Position(). Encodes and translates charsets + according to the arguments passed to SetEncoding(). + Encoding defaults to quoted printable and charset to + ISO-8859-1.

    + +

    Return Value:

    + +
    - B_OK if everything succeeds.
    + +

    + +

    + +


    + +

    + +
    + + + +
    +

    + + + + +
    +

    Mail + Kit 2 Root

    +
    +

    The + Public API

    +
    +

    +
    +
    + +


    +

    + +
    Mail Daemon 2 API +Documentation + +

    ©2001 Dr. Zoidberg +Enterprises

    + +