[Cover] [Previous Section] [Next Section] [Index]
Current chapter: Perl Fax Utilities: Fax Class
Section 54 out of 79 total sections
, Section 3 out of 3 sections in this chapter
Methods
The Fax class provides the following methods.
new()
Description
Creates a new Fax. Calling this method is a prerequisite for calling any other method of this class.
Synopsis
require Fax;
require Digest;
...
$fax = Fax->new($faxNumber, $faxContent, $contentType);
Arguments
|
Argument
|
Meaning
|
$faxNumber
|
(string) Fax number of recipient.
|
$faxContent
|
(string) Content of the facsimile.
|
$contentType
|
(string) MIME content type of the facsimile.
|
Returns
|
Value
|
Meaning
|
$self
|
Returns a reference to the Fax object on success.
|
Example
$fax = Fax->new("+1 800 555 1212", $faxContent, "text/plain");
addContent()
Description
Adds a document to the contents of the fax.
Synopsis
require Fax;
require Digest;
...
$fax->addContent($faxContent, $contentType);
Arguments
|
Argument
|
Meaning
|
$faxContent
|
(string) The content to add.
|
$contentType
|
(string) MIME content type of the new content.
|
Example
$fax->addContent($faxContent, "application/postscript");
setRecipientName()
Description
Sets the name of the fax recipient.
Synopsis
require Fax;
require Digest;
...
$fax->setRecipientName($name);
Arguments
|
Argument
|
Meaning
|
$name
|
(string) The name of the recipient.
|
Example
$fax->setRecipientName("John Doe");
setRecipientFax()
Description
Sets the fax number of the recipient.
Synopsis
require Fax;
require Digest;
...
$fax->setRecipientFax($fax);
Arguments
|
Argument
|
Meaning
|
$fax
|
(string) The fax number of the recipient.
|
Example
$fax->setRecipientFax("+1 800 555 1212");
setRecipientPhone()
Description
Sets the phone number of the recipient.
Synopsis
require Fax;
require Digest;
...
$fax->setRecipientPhone($phone);
Arguments
|
Argument
|
Meaning
|
$phone
|
(string) The phone number of the recipient.
|
Example
$fax->setRecipientPhone("+1 800 555 1212");
setSenderName()
Description
Sets the name of the sender.
Synopsis
require Fax;
require Digest;
...
$fax->setSenderName($name);
Arguments
|
Argument
|
Meaning
|
$name
|
(string) The name of the sender.
|
Example
$fax->setSenderName("John Doe");
setSenderFax()
Description
Sets the fax number of the sender.
Synopsis
require Fax;
require Digest;
...
$fax->setSenderFax($fax);
Arguments
|
Argument
|
Meaning
|
$fax
|
(string) The fax number of the sender.
|
Example
$fax->setSenderFax("+1 800 555 1212");
setSenderPhone()
Description
Sets the phone number of the sender.
Synopsis
require Fax;
require Digest;
...
$phone->setSenderPhone($phone);
Arguments
|
Argument
|
Meaning
|
$phone
|
(string) The phone number of the sender.
|
Example
$phone->setSenderPhone("+1 800 555 1212");
setComment()
Description
Sets the comment on the cover page.
Synopsis
require Fax;
require Digest;
...
$fax->setSenderFax($comment);
Arguments
|
Argument
|
Meaning
|
$comment
|
(string) The comment.
|
Example
$fax->setSenderFax("This is the cool code I told you about");
enableCoverPage()
Description
Specifies whether a cover page is attached to the fax.
Synopsis
require Fax;
require Digest;
...
$fax->enableCoverPage($addCover);
Arguments
|
Argument
|
Meaning
|
$addCover
|
(boolean) Include cover page (or not).
|
Example
$fax->enableCoverPage(1);
asString()
Description
Converts the multipart message to a string for printing.
Synopsis
require Fax;
require Digest;
...
$content = $fax->asString();
Returns
|
Value
|
Meaning
|
$content
|
The entire fax message as a single scalar string.
|
Example
$content = $fax->asString();
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 Fax Utilities: Fax Class
Section 54 out of 79 total sections
, Section 3 out of 3 sections in this chapter
Copyright © 1999, Unwired Planet, Inc. All rights
reserved.