[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Perl MIME Utilities: MultipartMsg Class
Section 51 out of 79 total sections , Section 4 out of 4 sections in this chapter


Methods

The MultipartMsg class provides the following methods.



new()


Description

Creates a new multipart message. Calling this method is a prerequisite for calling any other method of this class.


Arguments

Argument  Meaning  
$header  

(hash reference) The initial header of the message. 

$preamble  

(string) The initial preamble.  

$subParts  

(array reference) The initial subParts.  

$epilogue  

(string) The initial epilogue (optional).  


Returns

Value  Meaning  
$self  

Returns a reference to the MultipartMsg object on success  

undef  

Returns undef if called with invalid arguments  


Example



setBody()


Description

Dummy method that catches an illegal attempt to set the body of a multipart message. You can't set the body; you can only set the preamble and epilogue, or add subparts.



setPreamble()


Description

Sets the preamble of the body of a multipart message.


Synopsis


Arguments

Argument  Meaning  
$preamble  

(string) The new preamble of the message.  


Example



setEpilogue()


Description

Sets the epilogue of the body of a multipart message.


Synopsis


Arguments

Argument  Meaning  
$epilogue  

(string) The new epilogue of the message.  


Example



appendSubpart()


Description

Add a subpart to the multipart message. The subpart is appended after all the existing subparts.


Synopsis


Arguments

Argument  Meaning  
subPart,...  

(MsgEntity) The subpart(s) to add.  


Example



asString()


Description

Converts the multipart message to a string for printing.


Returns

Value  Meaning  
$content  

The entire message as a single scalar string.  


Example


Caveats

On non-Unix systems, call "binmode" on a file descriptor before writing this string out to it.


[Cover] [Previous Section] [Next Section] [Index]

Current chapter: Perl MIME Utilities: MultipartMsg Class
Section 51 out of 79 total sections , Section 4 out of 4 sections in this chapter


Copyright © 1999, Unwired Planet, Inc. All rights reserved.