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

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


Methods

The MsgEntity class provides the following methods.



new()


Description

Creates a new instance of a MsgEntity. Calling this method is a prerequisite for calling any other method of this class.


Synopsis


Synopsis


Arguments

Argument  Meaning  
$header  

(hash reference) The initial header of the message. 

$body  

(string) The initial body of the message. 


Returns

Value  Meaning  
$self  

Returns a reference to the MsgEntity object on success. 

$undef  

Returns undef if called with invalid arguments. 


Example



addHeader()


Description

Adds a header field to the message entity. If the header field already exists, it is overwritten.


Synopsis


Arguments

Argument  Meaning  
$name  

(string) The name of the header field. 

$value  

(string) The value of the header field. 


Example



setBody()


Description

Sets the body of a message entity.


Synopsis


Arguments

Argument  Meaning  
$newBody  

(string) The new body of the message entity. 


Example



asString()


Description

Converts the message entity to a string for printing.


Synopsis


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: MsgEntity Class
Section 47 out of 79 total sections , Section 4 out of 4 sections in this chapter


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