@node Mail/Internet, Mail/MIME, Mail/Header, Module List
@unnumbered manipulate Internet format (RFC 822) mail messages


@unnumberedsec NAME

Mail::Internet - manipulate Internet format (RFC 822) mail messages

@unnumberedsec SYNOPSIS

use Mail::Internet;

@unnumberedsec DESCRIPTION

This package provides a class object which can be used for reading, creating,
manipulating and writing a message with RFC822 compliant headers.

@unnumberedsubsec METHODS

@table @asis
@item body ()
Returns the body of the message. This is a reference to an array.
Each entry in the array represents a single line in the message.

@item print_header ( [ FILEHANDLE ] )
@itemx print_body ( [ FILEHANDLE ] )
@itemx print ( [ FILEHANDLE ] )
Print the header, body or whole message to file descriptor @emph{FILEHANDLE}.
@emph{$fd} should be a reference to a GLOB. If @emph{FILEHANDLE} is not given the
output will be sent to STDOUT.

@example
$mail->print( \*STDOUT );  # Print message to STDOUT
@end example

@item head ()
Returns the @code{Mail::Header} object which holds the headers for the current
message

@end table
@unnumberedsec UTILITY METHODS

The following methods are more a utility type that a manipulation
type of method.

@table @asis
@item remove_sig ( [ NLINES ] )
Attempts to remove a users signature from the body of a message. It does this 
by looking for a line equal to @code{@'-- @'} within the last @code{NLINES} of the
message. If found then that line and all lines after it will be removed. If
@code{NLINES} is not given a default value of 10 will be used. This would be of
most use in auto-reply scripts.

@item tidy_body ()
Removes all leading and trailing lines from the body that only contain
white spaces.

@item reply ()
Create a new object with header initialised for a reply to the current 
object. And the body will be a copy of the current message indented.

@item add_signature ( [ FILE ] )
Append a signature to the message. FILE is a file which contains
the signature, if not given then the file "$ENV@{HOME@}/.signature"
will be checked for.

@item smtpsend ()
Send a Mail::Internet message via SMTP

The message will be sent to all addresses on the To, Cc and Bcc
lines. The SMTP host is found by attempting connections first
to hosts specified in @code{$ENV@{SMTPHOSTS@}}, a colon separated list,
then @code{mailhost} and @code{localhost}.

@item nntppost ()
Post an article via NNTP, require News::NNTPClient.

@end table
@unnumberedsec SEE ALSO

@xref{Mail/Header,Mail/Header},
@xref{Mail/Address,Mail/Address},

@unnumberedsec AUTHOR

Graham Barr <Graham.Barr@@tiuk.ti.com>

@unnumberedsec REVISION

$Revision: 1.23 $

The VERSION is derived from the revision turning each number after the
first dot into a 2 digit number so

@example
Revision 1.8   => VERSION 1.08
Revision 1.2.3 => VERSION 1.0203
@end example

@unnumberedsec COPYRIGHT

Copyright (c) 1995 Graham Barr. All rights reserved. This program is free
software; you can redistribute it and/or modify it under the same terms
as Perl itself.

