GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MboxParser::Mail::Convertable(3) User Contributed Perl Documentation MboxParser::Mail::Convertable(3)

Mail::MboxParser::Mail::Convertable - convert mail for sending etc.

    use Mail::MboxParser;

    [...]
    
    # $msg is a Mail::MboxParser::Mail-object
    my $mail = $msg->make_convertable; 

    $mail->delete_from_header('date', 'message-id');
    $mail->replace_in_header('to', 'john.doe@foobar.com');
    $mail->add_to_header( ['cc', 'john.does.brother@foobar.com'],
                          where => 'BEHIND' );
    $mail->send('sendmail');

This class adds means to convert an email object into something that could be send via SMTP, NNTP or dumped to a file or filehandle. Therefore, methods are provided that change the structure of an email which includes adding and removing of header-fields, MIME-parts etc and transforming them into objects of related modules.

Currently, only basic manipulation of the header and sending using Mail::Mailer is provided. More is to come soon.

This class works non-destructive. You first create a Convertable-object and do any modifications on this while the Mail-object from which it was derived will not be touched.

delete_from_header(header-fields)
Given a list of header-field names, these fields will be removed from the header. If you want to re-send a message, you could for instance remove the cc-field cause otherwise the message would be carbon-copied to the addresses listed in the cc-field.
add_to_header(array-ref)
add_to_header(array-ref, where => 'BEFORE' | 'BEHIND')
add_to_header() takes a reference to a two-element list whose first element specifies the header-field to add or to add to while the second elements specifies the data that should be added. 'where' specifies whether to add at the beginning or at the end of the header. Defaults to 'BEHIND' if not given.
replace_in_header(header-field, new_data)
First element must be the header-field to be replaced while the second argument must be a string indicating what will be the new content of the header-field.
send(command, args)
Literally inherited from Mail::Internet. Commands can be "mail" (using the UNIX-mail program), "sendmail" (using a configured sendmail or compatible MTA like exim), "smtp" (for using Net::SMTP) and "test" which will only display what would be sent using /bin/echo. Additional arguments will be passed on to Mail::Mailer->new() which is in fact what Mail::Internet->send() uses.

For more details, see Mail::Mailer

This is version 0.55.

Tassilo von Parseval <tassilo.von.parseval@rwth-aachen.de>

Copyright (c) 2001-2005 Tassilo von Parseval. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Mail::Internet, Mail::Mailer
2005-12-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.