class PRFC822Channel |
A channel for sending/receiving RFC822 compliant mail messages.
![]() | PRFC822Channel ( Direction direction ) Construct a RFC822 aware channel. |
![]() | ~PRFC822Channel () Close the channel before destruction |
![]() | Close () Close the channel. |
![]() | Write ( const void* buf, PINDEX len ) Low level write to the channel. |
![]() | NewMessage ( Direction direction ) Begin a new message. |
![]() | MultipartMessage () Enter multipart MIME message mode. |
![]() | MultipartMessage ( const PString & boundary ) Enter multipart MIME message mode. |
![]() | NextPart ( const PString & boundary ) Indicate that a new multipart message part is to begin. |
![]() | SetFromAddress ( const PString & fromAddress ) Set the sender address. |
![]() | SetToAddress ( const PString & toAddress ) Set the recipient address(es). |
![]() | SetCC ( const PString & ccAddress ) Set the Carbon Copy address(es). |
![]() | SetBCC ( const PString & bccAddress ) Set the Blind Carbon Copy address(es). |
![]() | SetSubject ( const PString & subject ) Set the message subject. |
![]() | SetContentType ( const PString & contentType ) Set the content type. |
![]() | SetContentAttachment ( const PFilePath & filename ) Set the content disposition for attachments. |
![]() | SetTransferEncoding ( const PString & encoding, BOOL autoTranslate = TRUE ) Set the content transfer encoding. |
![]() | SetHeaderField ( const PString & name, const PString & value ) Set the and arbitrary header field. |
![]() | SendWithSMTP ( const PString & hostname ) Send this message using an SMTP socket. |
![]() | SendWithSMTP ( PSMTPClient* smtp ) Send this message using an SMTP socket. |
Construction
Overrides from class PObject
Overrides from class PChannel
Channel establish functions
Information functions
Reading functions
Writing functions
Miscellaneous functions
Error functions
Run Time Type functions
I/O functions
Comparison functions
A channel for sending/receiving RFC822 compliant mail messages. This encpsulates all that is required to send an RFC822 compliant message via another channel. It automatically adds/strips header information from the stream so the Read() and Write() functions only deal with the message body. For example to send a message using the SMTP classes: <PRE><CODE> PSMTPClient mail("mailserver"); if (mail.IsOpen()) { PRFC822Channel message; message.SetFromAddress("Me@here.com.au"); message.SetToAddress("Fred@somwhere.com"); if (message.Open(mail)) { if (mail.BeginMessage("Me@here.com.au", "Fred@somwhere.com")) { if (!message.Write(myMessageBody)) PError << "Mail write failed." << endl; if (!message.EndMessage()) PError << "Mail send failed." << endl; } } } else PError << "Mail conection failed." << endl; </PRE></CODE>
This override assures that the header is written before the body that will be output via this function.
Note this must be called before any writes are done to the message or part.
Note this must be called before any writes are done to the message or part.
The user may adjust the parts content type and other header fields after this call and before the first write of the parts body. The default Content-Type is "text/plain".
Note that all header fields are cleared from the previous part.
The default Content-Type is "text/plain".
Note that this will alter the Content-Type field to
If the encoding is "base64" (case insensitive) and , all writes will be treated as binary and translated into base64 encoding before output to the underlying channel.
Alphabetic index HTML hierarchy of classes or Java