{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Message::Construct::Forward (perldoc)\n\n## NAME\n\nMail::Message::Construct::Forward - forwarding a Mail::Message\n\n## SYNOPSIS\n\nmy Mail::Message $forward = $message->forward(To => 'you');\n$forward->send;\n\n## DESCRIPTION\n\nComplex functionality on Mail::Message objects is implemented in different files which are\nautoloaded. This file implements the functionality related to creating forwarded messages.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (1 subsections)\n- **DETAILS** (2 subsections)\n- **DIAGNOSTICS**\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Message::Construct::Forward",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Message::Construct::Forward - forwarding a Mail::Message",
        "synopsis": "my Mail::Message $forward = $message->forward(To => 'you');\n$forward->send;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Constructing a message",
                        "lines": 192
                    }
                ]
            },
            {
                "name": "DETAILS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Creating a forward",
                        "lines": 7
                    },
                    {
                        "name": "reply",
                        "lines": 75
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Message::Construct::Forward - forwarding a Mail::Message\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my Mail::Message $forward = $message->forward(To => 'you');\n$forward->send;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Complex functionality on Mail::Message objects is implemented in different files which are\nautoloaded. This file implements the functionality related to creating forwarded messages.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Constructing a message",
                        "content": "$obj->forward(%options)\nForward the content of this message. The body of the message to be forwarded is encapsulated\nin some accompanying text (if you have no wish for that, than \"bounce\" is your choice). A\nMail::Message object is returned on success.\n\nYou may forward a whole message, but also message parts. You may wish to overrule some of\nthe default header settings for the reply immediately, or you may do that later with \"set\"\non the header.\n\nWhen a multi-part body is encountered, and the message is included to ATTACH, the parts\nwhich look like signatures will be removed. If only one message remains, it will be the\nadded as single attachment, otherwise a nested multipart will be the result. The value of\nthis option does not matter, as long as it is present. See \"Mail::Message::Body::Multipart\".\n\n-Option    --Default\nBcc         undef\nCc          undef\nDate        <now>\nFrom        <'to' in current>\nMessage-ID  <uniquely generated>\nSubject     forwardSubject()\nTo          <required>\nbody        undef\ninclude     <if body then 'NO' else C<'INLINE'>>\npreamble    constructed from prelude and postlude\nsignature   undef\n\nBcc => ADDRESSES\nReceivers of blind carbon copies: their names will not be published to other message\nreceivers.\n\nCc => ADDRESSES\nThe carbon-copy receivers, by default none.\n\nDate => DATE\nThe date to be used in the message sent.\n\nFrom => ADDRESSES\nYour identification, by default taken from the \"To\" field of the source message.\n\nMessage-ID => STRING\nSupply a STRING as specific message-id for the forwarded message. By default, one is\ngenerated for you. If there are no angles around your id, they will be added.\n\nSubject => STRING|CODE\nForce the subject line to the specific STRING, or the result of the subroutine specified\nby CODE. The subroutine will be called passing the subject of the original message as only\nargument. By default, the forwardSubject() method is used.\n\nTo => ADDRESSES\nThe destination of your message. Obligatory. The ADDRESSES may be specified as string, a\nMail::Address object, or as array of Mail::Address objects.\n\nbody => OBJECT\nIf you specify a fully prepared body OBJECT, it will be used as forwarded message\ncontents. In this case, only the headers are constructed for you.\n\ninclude => 'NO'|'INLINE'|'ATTACH'|'ENCAPSULATE'\nMust the message where this is a reply to be included in the message? When \"INLINE\" is\ngiven, you may pass the options of forwardInline() as well.\n\nIn many applications, the forward option \"as attachment\" results in a structure which is\nproduced when this option is set to \"ENCAPSULATE\". Their default behavior is usually\n\"INLINE\".\n\nIt is only possible to inline textual messages, therefore binary or multi-part messages\nwill always be enclosed as attachment. Read the details in section \"Creating a forward\"..\n\npreamble => STRING|BODY\nPart which is attached before the forwarded message. If no preamble is given, then it is\nconstructed from the prelude and postlude. When these are also not present, you will still\nget a one liner: the result of forwardPrelude()\n\nsignature => BODY|MESSAGE\nThe signature to be added in case of a multi-part forward. The mime-type of the signature\nbody should indicate this is a used as such. However, in INLINE mode, the body will be\ntaken, a line containing '-- ' added before it, and added behind the epilogue.\n\n$obj->forwardAttach(%options)\nForward the message as *flat* attachment to the specified \"preamble\". You can specify all\noptions available to forward(), although a \"preamble\" which is provided as body object is\nrequired, and any specified \"body\" is ignored.\n\n-Option  --Default\npreamble  <required>\n\npreamble => BODY|PART\n\n$obj->forwardEncapsulate(%options)\nLike forwardAttach(), but in this case the original message is first encapsulated as nested\nmessage in a Mail::Message::Body::Nested, and then joint into a multipart.\n\nYou can specify all options available to forward(), although a \"preamble\" which is provided\nas body object is required, and any specified \"body\" is ignored. Signatures are not\nstripped. Signatures are not stripped.\n\n-Option  --Default\npreamble  <required>\n\npreamble => BODY|PART\n\n$obj->forwardInline(%options)\nThis method is equivalent in behavior to forward() with the option \"include\" set to\n'INLINE'. You can specify most of the fields which are available to forward() except\n\"include\" and \"body\".\n\n-Option         --Default\nisattached      \"[The forwarded message is attached]\\n\"\nmaxsignature    10\npostlude         undef\nprelude          undef\nquote            undef\nstripsignature  qr/^--\\s/\n\nisattached => STRING\nA forward on binary messages can not be inlined. Therefore, they are automatically\ntranslated into an attachment, as made by forwardAttach(). The obligatory preamble option\nto that method may be specified as option to this method, to be used in case of such a\nforward of a binary, but is otherwise constructed from the prelude, the value of this\noption, and the postlude.\n\nmaxsignature => INTEGER\nPassed to Mail::Message::Body::stripSignature(maxlines). Only effective for single-part\nmessages.\n\npostlude => BODY\nThe line(s) which to be added after the quoted reply lines. Create a body for it first.\nThis should not include the signature, which has its own option. The signature will be\nadded after the postlude when the forwarded message is \"INLINE\"d.\n\nprelude => BODY\nThe line(s) which will be added before the quoted forwarded lines. If nothing is\nspecified, the result of the forwardPrelude() method is used. When \"undef\" is specified,\nno prelude will be added.\n\nquote => CODE|STRING\nMangle the lines of an \"INLINE\"d reply with CODE, or by prepending a STRING to each line.\nThe routine specified by CODE is called when the line is in $.\n\nBy default, nothing is added before each line. This option is processed after the body has\nbeen decoded.\n\nstripsignature => REGEXP|STRING|CODE\nRemove the signature of the sender. The value of this parameter is passed to\nMail::Message::Body::stripSignature(pattern), unless the source text is not included. The\nsignature is stripped from the message before quoting.\n\n$obj->forwardNo(%options)\nConstruct a forward, where the whole body of the message is already constructed. That\ncomplex body is usually produced in forwardInline(), forwardAttach(), or\nforwardEncapsulate().\n\nThe %options are the same as for forward() except that \"body\" is required. Some other\noptions, like \"preamble\", are ignored.\n\n-Option--Default\nbody    <required>\n\nbody => BODY\n\n$obj->forwardPostlude()\nAdded after the forwarded message.\n\nexample:\n\n---- END forwarded message\n\n$obj->forwardPrelude()\nCreate a few lines to be included before the forwarded message content. The return is an\narray of lines.\n\nexample:\n\n---- BEGIN forwarded message\nFrom: him@somewhere.else.nl (Original Sender)\nTo: me@example.com (Me the receiver)\nCc: the.rest@world.net\nDate: Wed, 9 Feb 2000 15:44:05 -0500\n<blank line>\n\n$obj->forwardSubject(STRING)\nCreate a subject for a message which is a forward from this one. This routine tries to count\nthe level of reply in subject field, and transform it into a standard form. Please\ncontribute improvements.\n\nexample:\n\nsubject                 --> Forw: subject\nRe: subject             --> Forw: Re: subject\nRe[X]: subject          --> Forw: Re[X]: subject\n<blank>                 --> Forwarded\n"
                    }
                ]
            },
            "DETAILS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Creating a forward",
                        "content": "The main difference between bounce() and forward() is the reason for message processing. The\n*bounce* has no intention to modify the content of message: the same information is passed-on to\nsomeplace else. This may mean some conversions, but for instance, the Message-ID does not need\nto be changed.\n\nThe purpose of *forward()* is to pass on information which is modified: annotated or reduced.\nThe information is not sent back to the author of the original message (which is implemented by"
                    },
                    {
                        "name": "reply",
                        "content": "So: some information comes in, is modified, and than forwarded to someone else. Currently, there\nare four ways to get the original information included, which are explained in the next\nsections.\n\nAfter the creation of the forward, you may want to rebuild() the message to remove unnecessary\ncomplexities. Of course, that is not required.\n\nforward, specify a body\nWhen you specify forward(body), you have created your own body object to be used as content of\nthe forwarded message. This implies that forward(include) is 'NO': no automatic generation of\nthe forwarded body.\n\nforward, inline the original\nThe forward(include) is set to 'INLINE' (the default) This is the most complicated situation,\nbut most often used by MUAs: the original message is inserted textually in the new body. You can\nset-up automatic stripping of signatures, the way of encapsulation, and texts which should be\nadded before and after the encapsulated part.\n\nHowever, the result may not always be what you expect. For instance, some people use very long\nsignatures which will not be automatically stripped because the pass the threshold. So, you\nprobably need some manual intervention after the message is created and before it is sent.\n\nWhen a binary message is encountered, inlining is impossible. In that case, the message is\ntreated as if 'ENCAPSULATE' was requested.\n\nforward, attach the original\nWhen forward(include) is explicitly set to 'ATTACH' the result will be a multipart which\ncontains two parts. The first part will be your message, and the second the body of the original\nmessage.\n\nThis means that the headers of the forwarded message are used for the new message, and detached\nfrom the part which now contains the original body information. Content related headers will (of\ncourse) still be part of that part, but lines line \"To\" and \"Subject\" will not be stored with\nthat part.\n\nAs example of the structural transformation:\n\n# code: $original->printStructure;\nmultipart/alternative: The source message\ntext/plain: content in raw text\ntext/html: content as html\n\n# code: $fwd = $original->forward(include => 'ATTACH');\n# code: $fwd->printStructure\nmultipart/mixed: The source message\ntext/plain: prelude/postlude/signature\nmultipart/alternative\ntext/plain: content in raw text\ntext/html: content as html\n\nforward, encapsulate the original\nWhen forward(include) is explicitly set to 'ENCAPSULATE', then the original message is left\nin-tact as good as possible. The lines of the original message are used in the main message\nheader but also enclosed in the part header.\n\nThe encapsulation is implemented using a nested message, content type \"message/rfc822\". As\nexample of the structural transformation:\n\n# code: $original->printStructure;\nmultipart/alternative: The source message\ntext/plain: content in raw text\ntext/html: content as html\n\n# code: $fwd = $original->forward(include => 'ENCAPSULATE');\n# code: $fwd->printStructure\nmultipart/mixed: The source message\ntext/plain: prelude/postlude/signature\nmessage/rfc822\nmultipart/alternative: The source message\ntext/plain: content in raw text\ntext/html: content as html\n\nThe message structure is much more complex, but no information is lost. This is probably the\nreason why many MUAs use this when the forward an original message as attachment.\n"
                    }
                ]
            },
            "DIAGNOSTICS": {
                "content": "Error: Cannot include forward source as $include.\nUnknown alternative for the forward(include). Valid choices are \"NO\", \"INLINE\", \"ATTACH\",\nand \"ENCAPSULATE\".\n\nError: Method forwardAttach requires a preamble\nError: Method forwardEncapsulate requires a preamble\nError: No address to create forwarded to.\nIf a forward message is created, a destination address must be specified.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "This module is part of Mail-Message distribution version 3.015, built on December 11, 2023.\nWebsite: http://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2001-2023 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}