1MboxParser::Mail::ConveUrstearblCeo(n3t)ributed Perl DocMubmoexnPtaartsieorn::Mail::Convertable(3)
2
3
4

NAME

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

SYNOPSIS

9           use Mail::MboxParser;
10
11           [...]
12
13           # $msg is a Mail::MboxParser::Mail-object
14           my $mail = $msg->make_convertable;
15
16           $mail->delete_from_header('date', 'message-id');
17           $mail->replace_in_header('to', 'john.doe@foobar.com');
18           $mail->add_to_header( ['cc', 'john.does.brother@foobar.com'],
19                                 where => 'BEHIND' );
20           $mail->send('sendmail');
21

DESCRIPTION

23       This class adds means to convert an email object into something that
24       could be send via SMTP, NNTP or dumped to a file or filehandle.
25       Therefore, methods are provided that change the structure of an email
26       which includes adding and removing of header-fields, MIME-parts etc and
27       transforming them into objects of related modules.
28
29       Currently, only basic manipulation of the header and sending using
30       Mail::Mailer is provided. More is to come soon.
31
32       This class works non-destructive. You first create a Convertable-object
33       and do any modifications on this while the Mail-object from which it
34       was derived will not be touched.
35

METHODS

37       delete_from_header(header-fields)
38           Given a list of header-field names, these fields will be removed
39           from the header. If you want to re-send a message, you could for
40           instance remove the cc-field cause otherwise the message would be
41           carbon-copied to the addresses listed in the cc-field.
42
43       add_to_header(array-ref)
44       add_to_header(array-ref, where => 'BEFORE' | 'BEHIND')
45           add_to_header() takes a reference to a two-element list whose first
46           element specifies the header-field to add or to add to while the
47           second elements specifies the data that should be added. 'where'
48           specifies whether to add at the beginning or at the end of the
49           header. Defaults to 'BEHIND' if not given.
50
51       replace_in_header(header-field, new_data)
52           First element must be the header-field to be replaced while the
53           second argument must be a string indicating what will be the new
54           content of the header-field.
55
56       send(command, args)
57           Literally inherited from Mail::Internet. Commands can be "mail"
58           (using the UNIX-mail program), "sendmail" (using a configured
59           sendmail or compatible MTA like exim), "smtp" (for using Net::SMTP)
60           and "test" which will only display what would be sent using
61           /bin/echo. Additional arguments will be passed on to
62           Mail::Mailer->new() which is in fact what Mail::Internet->send()
63           uses.
64
65           For more details, see Mail::Mailer
66

VERSION

68       This is version 0.55.
69
71       Tassilo von Parseval <tassilo.von.parseval@rwth-aachen.de>
72
73       Copyright (c)  2001-2005 Tassilo von Parseval.  This program is free
74       software; you can redistribute it and/or modify it under the same terms
75       as Perl itself.
76

SEE ALSO

78       Mail::Internet, Mail::Mailer
79
80
81
82perl v5.30.0                      2019-07-26  MboxParser::Mail::Convertable(3)
Impressum