Or you can sail right on through and be sending e-mail from your own applications in a matter of minutes using your friend, the BMailMessage.
BMailMessage *mail; char *message; mail = new BMailMessage(); mail->AddHeaderField(B_MAIL_TO, "bob@uncle.com"); mail->AddHeaderField(B_MAIL_SUBJECT, "Hi"); message = "Hi, Uncle Bob!"; mail->AddContent(message, strlen(message));
mail->AddEnclosure("/boot/home/file.zip");
Send():mail->Send();
BMailMessage(void)
~BMailMessage()
status_t AddContent(const char *text, int32 length, uint32 encoding = B_ISO1_CONVERSION, bool replace = false) status_t AddContent(const char *text, int32 length, const char *encoding, bool replace = false)
true, any existing text is deleted before the new content is added; otherwise, the specified text is appended to the end of the existing message content.B_OK. The content was changed without error.B_ERROR. Unable to add the new content.AddEnclosure() add a file to the message, given either an entry_ref pointer or a pathname. The third form adds a block of memory (of the given length) to the message as an enclosure, with the specified MIME type.B_OK. The content was changed without error.B_ERROR. Unable to add the new enclosure.status_t AddHeaderField(const char *field_name, const char *field_str, bool replace = false)
true, all existing header fields of the specified name aredeleted before adding the new header field; if replace is false, a new header whose field is named field_name is added.B_OK. The content was changed without error.B_ERROR. Unable to add the new header field.status_t Send(bool send_now = false, bool remove_when_sent = false)
check_for_mail() is called or the mail daemon performs an automatic mail check.true, the message will be deleted from the user's disk drive after it has been sent; otherwise, it will be saved for posterity.B_OK. The content was changed without error.B_MAIL_NO_RECIPIENT. There needs to be either a "To" or "Bcc" field in the message.BMessage::SendMessage().