{
    "mode": "perldoc",
    "parameter": "MIME::Lite",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/MIME%3A%3ALite/json",
    "generated": "2026-09-10T04:46:29Z",
    "synopsis": "Create and send using the default send method for your OS a single-part message:\nuse MIME::Lite;\n### Create a new single-part message, to send a GIF file:\n$msg = MIME::Lite->new(\nFrom     => 'me@myhost.com',\nTo       => 'you@yourhost.com',\nCc       => 'some@other.com, some@more.com',\nSubject  => 'Helloooooo, nurse!',\nType     => 'image/gif',\nEncoding => 'base64',\nPath     => 'hellonurse.gif'\n);\n$msg->send; # send via default\nCreate a multipart message (i.e., one with attachments) and send it via SMTP\n### Create a new multipart message:\n$msg = MIME::Lite->new(\nFrom    => 'me@myhost.com',\nTo      => 'you@yourhost.com',\nCc      => 'some@other.com, some@more.com',\nSubject => 'A message with 2 parts...',\nType    => 'multipart/mixed'\n);\n### Add parts (each \"attach\" has same arguments as \"new\"):\n$msg->attach(\nType     => 'TEXT',\nData     => \"Here's the GIF file you wanted\"\n);\n$msg->attach(\nType     => 'image/gif',\nPath     => 'aaa000123.gif',\nFilename => 'logo.gif',\nDisposition => 'attachment'\n);\n### use Net::SMTP to do the sending\n$msg->send('smtp','some.host', Debug=>1 );\nOutput a message:\n### Format as a string:\n$str = $msg->asstring;\n### Print to a filehandle (say, a \"sendmail\" stream):\n$msg->print(\\*SENDMAIL);\nSend a message:\n### Send in the \"best\" way (the default is to use \"sendmail\"):\n$msg->send;\n### Send a specific way:\n$msg->send('type',@args);\nSpecify default send method:\nMIME::Lite->send('smtp','some.host',Debug=>0);\nwith authentication\nMIME::Lite->send('smtp','some.host', AuthUser=>$user, AuthPass=>$pass);\nusing SSL\nMIME::Lite->send('smtp','some.host', SSL => 1, Port => 465 );",
    "sections": {
        "NAME": {
            "content": "MIME::Lite - low-calorie MIME generator\n\nWAIT!\nMIME::Lite is not recommended by its current maintainer. There are a number of alternatives,\nlike Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead.\nMIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of\nrefactoring due to the availability of better alternatives. Please consider using something\nelse.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Create and send using the default send method for your OS a single-part message:\n\nuse MIME::Lite;\n### Create a new single-part message, to send a GIF file:\n$msg = MIME::Lite->new(\nFrom     => 'me@myhost.com',\nTo       => 'you@yourhost.com',\nCc       => 'some@other.com, some@more.com',\nSubject  => 'Helloooooo, nurse!',\nType     => 'image/gif',\nEncoding => 'base64',\nPath     => 'hellonurse.gif'\n);\n$msg->send; # send via default\n\nCreate a multipart message (i.e., one with attachments) and send it via SMTP\n\n### Create a new multipart message:\n$msg = MIME::Lite->new(\nFrom    => 'me@myhost.com',\nTo      => 'you@yourhost.com',\nCc      => 'some@other.com, some@more.com',\nSubject => 'A message with 2 parts...',\nType    => 'multipart/mixed'\n);\n\n### Add parts (each \"attach\" has same arguments as \"new\"):\n$msg->attach(\nType     => 'TEXT',\nData     => \"Here's the GIF file you wanted\"\n);\n$msg->attach(\nType     => 'image/gif',\nPath     => 'aaa000123.gif',\nFilename => 'logo.gif',\nDisposition => 'attachment'\n);\n### use Net::SMTP to do the sending\n$msg->send('smtp','some.host', Debug=>1 );\n\nOutput a message:\n\n### Format as a string:\n$str = $msg->asstring;\n\n### Print to a filehandle (say, a \"sendmail\" stream):\n$msg->print(\\*SENDMAIL);\n\nSend a message:\n\n### Send in the \"best\" way (the default is to use \"sendmail\"):\n$msg->send;\n### Send a specific way:\n$msg->send('type',@args);\n\nSpecify default send method:\n\nMIME::Lite->send('smtp','some.host',Debug=>0);\n\nwith authentication\n\nMIME::Lite->send('smtp','some.host', AuthUser=>$user, AuthPass=>$pass);\n\nusing SSL\n\nMIME::Lite->send('smtp','some.host', SSL => 1, Port => 465 );\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "In the never-ending quest for great taste with fewer calories, we proudly present: *MIME::Lite*.\n\nMIME::Lite is intended as a simple, standalone module for generating (not parsing!) MIME\nmessages... specifically, it allows you to output a simple, decent single- or multi-part message\nwith text or binary attachments. It does not require that you have the Mail:: or MIME:: modules\ninstalled, but will work with them if they are.\n\nYou can specify each message part as either the literal data itself (in a scalar or array), or\nas a string which can be given to open() to get a readable filehandle (e.g., \"<filename\" or\n\"somecommand|\").\n\nYou don't need to worry about encoding your message data: this module will do that for you. It\nhandles the 5 standard MIME encodings.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Create a simple message containing just text",
                    "content": "$msg = MIME::Lite->new(\nFrom     =>'me@myhost.com',\nTo       =>'you@yourhost.com',\nCc       =>'some@other.com, some@more.com',\nSubject  =>'Helloooooo, nurse!',\nData     =>\"How's it goin', eh?\"\n);\n"
                },
                {
                    "name": "Create a simple message containing just an image",
                    "content": "$msg = MIME::Lite->new(\nFrom     =>'me@myhost.com',\nTo       =>'you@yourhost.com',\nCc       =>'some@other.com, some@more.com',\nSubject  =>'Helloooooo, nurse!',\nType     =>'image/gif',\nEncoding =>'base64',\nPath     =>'hellonurse.gif'\n);\n"
                },
                {
                    "name": "Create a multipart message",
                    "content": "### Create the multipart \"container\":\n$msg = MIME::Lite->new(\nFrom    =>'me@myhost.com',\nTo      =>'you@yourhost.com',\nCc      =>'some@other.com, some@more.com',\nSubject =>'A message with 2 parts...',\nType    =>'multipart/mixed'\n);\n\n### Add the text message part:\n### (Note that \"attach\" has same arguments as \"new\"):\n$msg->attach(\nType     =>'TEXT',\nData     =>\"Here's the GIF file you wanted\"\n);\n\n### Add the image part:\n$msg->attach(\nType        =>'image/gif',\nPath        =>'aaa000123.gif',\nFilename    =>'logo.gif',\nDisposition => 'attachment'\n);\n"
                },
                {
                    "name": "Attach a GIF to a text message",
                    "content": "This will create a multipart message exactly as above, but using the \"attach to singlepart\"\nhack:\n\n### Start with a simple text message:\n$msg = MIME::Lite->new(\nFrom    =>'me@myhost.com',\nTo      =>'you@yourhost.com',\nCc      =>'some@other.com, some@more.com',\nSubject =>'A message with 2 parts...',\nType    =>'TEXT',\nData    =>\"Here's the GIF file you wanted\"\n);\n\n### Attach a part... the make the message a multipart automatically:\n$msg->attach(\nType     =>'image/gif',\nPath     =>'aaa000123.gif',\nFilename =>'logo.gif'\n);\n"
                },
                {
                    "name": "Attach a pre-prepared part to a message",
                    "content": "### Create a standalone part:\n$part = MIME::Lite->new(\nTop      => 0,\nType     =>'text/html',\nData     =>'<H1>Hello</H1>',\n);\n$part->attr('content-type.charset' => 'UTF-8');\n$part->add('X-Comment' => 'A message for you');\n\n### Attach it to any message:\n$msg->attach($part);\n"
                },
                {
                    "name": "Print a message to a filehandle",
                    "content": "### Write it to a filehandle:\n$msg->print(\\*STDOUT);\n\n### Write just the header:\n$msg->printheader(\\*STDOUT);\n\n### Write just the encoded body:\n$msg->printbody(\\*STDOUT);\n"
                },
                {
                    "name": "Print a message into a string",
                    "content": "### Get entire message as a string:\n$str = $msg->asstring;\n\n### Get just the header:\n$str = $msg->headerasstring;\n\n### Get just the encoded body:\n$str = $msg->bodyasstring;\n"
                },
                {
                    "name": "Send a message",
                    "content": "### Send in the \"best\" way (the default is to use \"sendmail\"):\n$msg->send;\n\nSend an HTML document... with images included!\n$msg = MIME::Lite->new(\nTo      =>'you@yourhost.com',\nSubject =>'HTML with in-line images!',\nType    =>'multipart/related'\n);\n$msg->attach(\nType => 'text/html',\nData => qq{\n<body>\nHere's <i>my</i> image:\n<img src=\"cid:myimage.gif\">\n</body>\n},\n);\n$msg->attach(\nType => 'image/gif',\nId   => 'myimage.gif',\nPath => '/path/to/somefile.gif',\n);\n$msg->send();\n"
                },
                {
                    "name": "Change how messages are sent",
                    "content": "### Do something like this in your 'main':\nif ($IDONTHAVESENDMAIL) {\nMIME::Lite->send('smtp', $host, Timeout=>60,\nAuthUser=>$user, AuthPass=>$pass);\n}\n\n### Now this will do the right thing:\n$msg->send;         ### will now use Net::SMTP as shown above\n"
                }
            ]
        },
        "PUBLIC INTERFACE": {
            "content": "",
            "subsections": [
                {
                    "name": "Global configuration",
                    "content": "To alter the way the entire module behaves, you have the following methods/options:\n\nMIME::Lite->fieldorder()\nWhen used as a classmethod, this changes the default order in which headers are output for\n*all* messages. However, please consider using the instance method variant instead, so you\nwon't stomp on other message senders in the same application.\n\nMIME::Lite->quiet()\nThis classmethod can be used to suppress/unsuppress all warnings coming from this module.\n\nMIME::Lite->send()\nWhen used as a classmethod, this can be used to specify a different default mechanism for\nsending message. The initial default is:\n\nMIME::Lite->send(\"sendmail\", \"/usr/lib/sendmail -t -oi -oem\");\n\nHowever, you should consider the similar but smarter and taint-safe variant:\n\nMIME::Lite->send(\"sendmail\");\n\nOr, for non-Unix users:\n\nMIME::Lite->send(\"smtp\");\n\n$MIME::Lite::AUTOCC\nIf true, automatically send to the Cc/Bcc addresses for sendbysmtp(). Default is true.\n\n$MIME::Lite::AUTOCONTENTTYPE\nIf true, try to automatically choose the content type from the file name in new()/build().\nIn other words, setting this true changes the default \"Type\" from \"TEXT\" to \"AUTO\".\n\nDefault is false, since we must maintain backwards-compatibility with prior behavior. Please\nconsider keeping it false, and just using Type 'AUTO' when you build() or attach().\n\n$MIME::Lite::AUTOENCODE\nIf true, automatically choose the encoding from the content type. Default is true.\n\n$MIME::Lite::AUTOVERIFY\nIf true, check paths to attachments right before printing, raising an exception if any path\nis unreadable. Default is true.\n\n$MIME::Lite::PARANOID\nIf true, we won't attempt to use MIME::Base64, MIME::QuotedPrint, or MIME::Types, even if\nthey're available. Default is false. Please consider keeping it false, and trusting these\nother packages to do the right thing.\n"
                },
                {
                    "name": "Construction",
                    "content": "new [PARAMHASH]\n*Class method, constructor.* Create a new message object.\n\nIf any arguments are given, they are passed into build(); otherwise, just the empty object\nis created.\n\nattach PART\nattach PARAMHASH...\n*Instance method.* Add a new part to this message, and return the new part.\n\nIf you supply a single PART argument, it will be regarded as a MIME::Lite object to be\nattached. Otherwise, this method assumes that you are giving in the pairs of a PARAMHASH\nwhich will be sent into new() to create the new part.\n\nOne of the possibly-quite-useful hacks thrown into this is the \"attach-to-singlepart\" hack:\nif you attempt to attach a part (let's call it \"part 1\") to a message that doesn't have a\ncontent-type of \"multipart\" or \"message\", the following happens:\n\n*   A new part (call it \"part 0\") is made.\n\n*   The MIME attributes and data (but *not* the other headers) are cut from the \"self\"\nmessage, and pasted into \"part 0\".\n\n*   The \"self\" is turned into a \"multipart/mixed\" message.\n\n*   The new \"part 0\" is added to the \"self\", and *then* \"part 1\" is added.\n\nOne of the nice side-effects is that you can create a text message and then add zero or more\nattachments to it, much in the same way that a user agent like Netscape allows you to do.\n\nbuild [PARAMHASH]\n*Class/instance method, initializer.* Create (or initialize) a MIME message object.\nNormally, you'll use the following keys in PARAMHASH:\n\n* Data, FH, or Path      (either one of these, or none if multipart)\n* Type                   (e.g., \"image/jpeg\")\n* From, To, and Subject  (if this is the \"top level\" of a message)\n\nThe PARAMHASH can contain the following keys:\n\n(fieldname)\nAny field you want placed in the message header, taken from the standard list of header\nfields (you don't need to worry about case):\n\nApproved      Encrypted     Received      Sender\nBcc           From          References    Subject\nCc            Keywords      Reply-To      To\nComments      Message-ID    Resent-*      X-*\nContent-*     MIME-Version  Return-Path\nDate                        Organization\n\nTo give experienced users some veto power, these fields will be set *after* the ones I\nset... so be careful: *don't set any MIME fields* (like \"Content-type\") unless you know\nwhat you're doing!\n\nTo specify a fieldname that's *not* in the above list, even one that's identical to an\noption below, just give it with a trailing \":\", like \"My-field:\". When in doubt, that\n*always* signals a mail field (and it sort of looks like one too).\n\nData\n*Alternative to \"Path\" or \"FH\".* The actual message data. This may be a scalar or a ref\nto an array of strings; if the latter, the message consists of a simple concatenation of\nall the strings in the array.\n\nDatestamp\n*Optional.* If given true (or omitted), we force the creation of a \"Date:\" field stamped\nwith the current date/time if this is a top-level message. You may want this if using\nsendbysmtp(). If you don't want this to be done, either provide your own Date or\nexplicitly set this to false.\n\nDisposition\n*Optional.* The content disposition, \"inline\" or \"attachment\". The default is \"inline\".\n\nEncoding\n*Optional.* The content transfer encoding that should be used to encode your data:\n\nUse encoding:     | If your message contains:\n------------------------------------------------------------\n7bit              | Only 7-bit text, all lines <1000 characters\n8bit              | 8-bit text, all lines <1000 characters\nquoted-printable  | 8-bit text or long lines (more reliable than \"8bit\")\nbase64            | Largely non-textual data: a GIF, a tar file, etc.\n\nThe default is taken from the Type; generally it is \"binary\" (no encoding) for text/*,\nmessage/*, and multipart/*, and \"base64\" for everything else. A value of \"binary\" is\ngenerally *not* suitable for sending anything but ASCII text files with lines under 1000\ncharacters, so consider using one of the other values instead.\n\nIn the case of \"7bit\"/\"8bit\", long lines are automatically chopped to legal length; in\nthe case of \"7bit\", all 8-bit characters are automatically *removed*. This may not be\nwhat you want, so pick your encoding well! For more info, see \"A MIME PRIMER\".\n\nFH  *Alternative to \"Data\" or \"Path\".* Filehandle containing the data, opened for reading.\nSee \"ReadNow\" also.\n\nFilename\n*Optional.* The name of the attachment. You can use this to supply a recommended\nfilename for the end-user who is saving the attachment to disk. You only need this if\nthe filename at the end of the \"Path\" is inadequate, or if you're using \"Data\" instead\nof \"Path\". You should *not* put path information in here (e.g., no \"/\" or \"\\\" or \":\"\ncharacters should be used).\n\nId  *Optional.* Same as setting \"content-id\".\n\nLength\n*Optional.* Set the content length explicitly. Normally, this header is automatically\ncomputed, but only under certain circumstances (see \"Benign limitations\").\n\nPath\n*Alternative to \"Data\" or \"FH\".* Path to a file containing the data... actually, it can\nbe any open()able expression. If it looks like a path, the last element will\nautomatically be treated as the filename. See \"ReadNow\" also.\n\nReadNow\n*Optional, for use with \"Path\".* If true, will open the path and slurp the contents into\ncore now. This is useful if the Path points to a command and you don't want to run the\ncommand over and over if outputting the message several times. Fatal exception raised if\nthe open fails.\n\nTop *Optional.* If defined, indicates whether or not this is a \"top-level\" MIME message. The\nparts of a multipart message are *not* top-level. Default is true.\n\nType\n*Optional.* The MIME content type, or one of these special values (case-sensitive):\n\n\"TEXT\"   means \"text/plain\"\n\"BINARY\" means \"application/octet-stream\"\n\"AUTO\"   means attempt to guess from the filename, falling back\nto 'application/octet-stream'.  This is good if you have\nMIME::Types on your system and you have no idea what\nfile might be used for the attachment.\n\nThe default is \"TEXT\", but it will be \"AUTO\" if you set $AUTOCONTENTTYPE to true\n(sorry, but you have to enable it explicitly, since we don't want to break code which\ndepends on the old behavior).\n\nA picture being worth 1000 words (which is of course 2000 bytes, so it's probably more of an\n\"icon\" than a \"picture\", but I digress...), here are some examples:\n\n$msg = MIME::Lite->build(\nFrom     => 'yelling@inter.com',\nTo       => 'stocking@fish.net',\nSubject  => \"Hi there!\",\nType     => 'TEXT',\nEncoding => '7bit',\nData     => \"Just a quick note to say hi!\"\n);\n\n$msg = MIME::Lite->build(\nFrom     => 'dorothy@emerald-city.oz',\nTo       => 'gesundheit@edu.edu.edu',\nSubject  => \"A gif for U\"\nType     => 'image/gif',\nPath     => \"/home/httpd/logo.gif\"\n);\n\n$msg = MIME::Lite->build(\nFrom     => 'laughing@all.of.us',\nTo       => 'scarlett@fiddle.dee.de',\nSubject  => \"A gzipp'ed tar file\",\nType     => 'x-gzip',\nPath     => \"gzip < /usr/inc/somefile.tar |\",\nReadNow  => 1,\nFilename => \"somefile.tgz\"\n);\n\nTo show you what's really going on, that last example could also have been written:\n\n$msg = new MIME::Lite;\n$msg->build(\nType     => 'x-gzip',\nPath     => \"gzip < /usr/inc/somefile.tar |\",\nReadNow  => 1,\nFilename => \"somefile.tgz\"\n);\n$msg->add(From    => \"laughing@all.of.us\");\n$msg->add(To      => \"scarlett@fiddle.dee.de\");\n$msg->add(Subject => \"A gzipp'ed tar file\");\n\nSetting/getting headers and attributes\nadd TAG,VALUE\n*Instance method.* Add field TAG with the given VALUE to the end of the header. The TAG will\nbe converted to all-lowercase, and the VALUE will be made \"safe\" (returns will be given a\ntrailing space).\n\nBeware: any MIME fields you \"add\" will override any MIME attributes I have when it comes\ntime to output those fields. Normally, you will use this method to add *non-MIME* fields:\n\n$msg->add(\"Subject\" => \"Hi there!\");\n\nGiving VALUE as an arrayref will cause all those values to be added. This is only useful for\nspecial multiple-valued fields like \"Received\":\n\n$msg->add(\"Received\" => [\"here\", \"there\", \"everywhere\"]\n\nGiving VALUE as the empty string adds an invisible placeholder to the header, which can be\nused to suppress the output of the \"Content-*\" fields or the special \"MIME-Version\" field.\nWhen suppressing fields, you should use replace() instead of add():\n\n$msg->replace(\"Content-disposition\" => \"\");\n\n*Note:* add() is probably going to be more efficient than replace(), so you're better off\nusing it for most applications if you are certain that you don't need to delete() the field\nfirst.\n\n*Note:* the name comes from Mail::Header.\n\nattr ATTR,[VALUE]\n*Instance method.* Set MIME attribute ATTR to the string VALUE. ATTR is converted to\nall-lowercase. This method is normally used to set/get MIME attributes:\n\n$msg->attr(\"content-type\"         => \"text/html\");\n$msg->attr(\"content-type.charset\" => \"US-ASCII\");\n$msg->attr(\"content-type.name\"    => \"homepage.html\");\n\nThis would cause the final output to look something like this:\n\nContent-type: text/html; charset=US-ASCII; name=\"homepage.html\"\n\nNote that the special empty sub-field tag indicates the anonymous first sub-field.\n\nGiving VALUE as undefined will cause the contents of the named subfield to be deleted.\n\nSupplying no VALUE argument just returns the attribute's value:\n\n$type = $msg->attr(\"content-type\");        ### returns \"text/html\"\n$name = $msg->attr(\"content-type.name\");   ### returns \"homepage.html\"\n\ndelete TAG\n*Instance method.* Delete field TAG with the given VALUE to the end of the header. The TAG\nwill be converted to all-lowercase.\n\n$msg->delete(\"Subject\");\n\n*Note:* the name comes from Mail::Header.\n\nfieldorder FIELD,...FIELD\n*Class/instance method.* Change the order in which header fields are output for this object:\n\n$msg->fieldorder('from', 'to', 'content-type', 'subject');\n\nWhen used as a class method, changes the default settings for all objects:\n\nMIME::Lite->fieldorder('from', 'to', 'content-type', 'subject');\n\nCase does not matter: all field names will be coerced to lowercase. In either case, supply\nthe empty array to restore the default ordering.\n\nfields\n*Instance method.* Return the full header for the object, as a ref to an array of \"[TAG,\nVALUE]\" pairs, where each TAG is all-lowercase. Note that any fields the user has explicitly\nset will override the corresponding MIME fields that we would otherwise generate. So, don't\nsay...\n\n$msg->set(\"Content-type\" => \"text/html; charset=US-ASCII\");\n\nunless you want the above value to override the \"Content-type\" MIME field that we would\nnormally generate.\n\n*Note:* I called this \"fields\" because the header() method of Mail::Header returns something\ndifferent, but similar enough to be confusing.\n\nYou can change the order of the fields: see \"fieldorder\". You really shouldn't need to do\nthis, but some people have to deal with broken mailers.\n\nfilename [FILENAME]\n*Instance method.* Set the filename which this data will be reported as. This actually sets\nboth \"standard\" attributes.\n\nWith no argument, returns the filename as dictated by the content-disposition.\n\nget TAG,[INDEX]\n*Instance method.* Get the contents of field TAG, which might have been set with set() or\nreplace(). Returns the text of the field.\n\n$ml->get('Subject', 0);\n\nIf the optional 0-based INDEX is given, then we return the INDEX'th occurrence of field TAG.\nOtherwise, we look at the context: In a scalar context, only the first (0th) occurrence of\nthe field is returned; in an array context, *all* occurrences are returned.\n\n*Warning:* this should only be used with non-MIME fields. Behavior with MIME fields is TBD,\nand will raise an exception for now.\n\ngetlength\n*Instance method.* Recompute the content length for the message *if the process is trivial*,\nsetting the \"content-length\" attribute as a side-effect:\n\n$msg->getlength;\n\nReturns the length, or undefined if not set.\n\n*Note:* the content length can be difficult to compute, since it involves assembling the\nentire encoded body and taking the length of it (which, in the case of multipart messages,\nmeans freezing all the sub-parts, etc.).\n\nThis method only sets the content length to a defined value if the message is a singlepart\nwith \"binary\" encoding, *and* the body is available either in-core or as a simple file.\nOtherwise, the content length is set to the undefined value.\n\nSince content-length is not a standard MIME field anyway (that's right, kids: it's not in\nthe MIME RFCs, it's an HTTP thing), this seems pretty fair.\n\nparts\n*Instance method.* Return the parts of this entity, and this entity only. Returns empty\narray if this entity has no parts.\n\nThis is not recursive! Parts can have sub-parts; use partsDFS() to get everything.\n\npartsDFS\n*Instance method.* Return the list of all MIME::Lite objects included in the entity,\nstarting with the entity itself, in depth-first-search order. If this object has no parts,\nit alone will be returned.\n\npreamble [TEXT]\n*Instance method.* Get/set the preamble string, assuming that this object has subparts. Set\nit to undef for the default string.\n\nreplace TAG,VALUE\n*Instance method.* Delete all occurrences of fields named TAG, and add a new field with the\ngiven VALUE. TAG is converted to all-lowercase.\n\nBeware the special MIME fields (MIME-version, Content-*): if you \"replace\" a MIME field, the\nreplacement text will override the *actual* MIME attributes when it comes time to output\nthat field. So normally you use attr() to change MIME fields and add()/replace() to change\n*non-MIME* fields:\n\n$msg->replace(\"Subject\" => \"Hi there!\");\n\nGiving VALUE as the *empty string* will effectively *prevent* that field from being output.\nThis is the correct way to suppress the special MIME fields:\n\n$msg->replace(\"Content-disposition\" => \"\");\n\nGiving VALUE as *undefined* will just cause all explicit values for TAG to be deleted,\nwithout having any new values added.\n\n*Note:* the name of this method comes from Mail::Header.\n\nscrub\n*Instance method.* This is Alpha code. If you use it, please let me know how it goes.\nRecursively goes through the \"parts\" tree of this message and tries to find MIME attributes\nthat can be removed. With an array argument, removes exactly those attributes; e.g.:\n\n$msg->scrub(['content-disposition', 'content-length']);\n\nIs the same as recursively doing:\n\n$msg->replace('Content-disposition' => '');\n$msg->replace('Content-length'      => '');\n\nSetting/getting message data\nbinmode [OVERRIDE]\n*Instance method.* With no argument, returns whether or not it thinks that the data (as\ngiven by the \"Path\" argument of build()) should be read using binmode() (for example, when\nreadnow() is invoked).\n\nThe default behavior is that any content type other than \"text/*\" or \"message/*\" is\nbinmode'd; this should in general work fine.\n\nWith a defined argument, this method sets an explicit \"override\" value. An undefined\nargument unsets the override. The new current value is returned.\n\ndata [DATA]\n*Instance method.* Get/set the literal DATA of the message. The DATA may be either a scalar,\nor a reference to an array of scalars (which will simply be joined).\n\n*Warning:* setting the data causes the \"content-length\" attribute to be recomputed (possibly\nto nothing).\n\nfh [FILEHANDLE]\n*Instance method.* Get/set the FILEHANDLE which contains the message data.\n\nTakes a filehandle as an input and stores it in the object. This routine is similar to\npath(); one important difference is that no attempt is made to set the content length.\n\npath [PATH]\n*Instance method.* Get/set the PATH to the message data.\n\n*Warning:* setting the path recomputes any existing \"content-length\" field, and re-sets the\n\"filename\" (to the last element of the path if it looks like a simple path, and to nothing\nif not).\n\nresetfh [FILEHANDLE]\n*Instance method.* Set the current position of the filehandle back to the beginning. Only\napplies if you used \"FH\" in build() or attach() for this message.\n\nReturns false if unable to reset the filehandle (since not all filehandles are seekable).\n\nreadnow\n*Instance method.* Forces data from the path/filehandle (as specified by build()) to be read\ninto core immediately, just as though you had given it literally with the \"Data\" keyword.\n\nNote that the in-core data will always be used if available.\n\nBe aware that everything is slurped into a giant scalar: you may not want to use this if\nsending tar files! The benefit of *not* reading in the data is that very large files can be\nhandled by this module if left on disk until the message is output via print() or\nprintbody().\n\nsign PARAMHASH\n*Instance method.* Sign the message. This forces the message to be read into core, after\nwhich the signature is appended to it.\n\nData\nAs in build(): the literal signature data. Can be either a scalar or a ref to an array\nof scalars.\n\nPath\nAs in build(): the path to the file.\n\nIf no arguments are given, the default is:\n\nPath => \"$ENV{HOME}/.signature\"\n\nThe content-length is recomputed.\n\nverifydata\n*Instance method.* Verify that all \"paths\" to attached data exist, recursively. It might be\na good idea for you to do this before a print(), to prevent accidental partial output if a\nfile might be missing. Raises exception if any path is not readable.\n"
                },
                {
                    "name": "Output",
                    "content": "print [OUTHANDLE]\n*Instance method.* Print the message to the given output handle, or to the\ncurrently-selected filehandle if none was given.\n\nAll OUTHANDLE has to be is a filehandle (possibly a glob ref), or any object that responds\nto a print() message.\n\nprintbody [OUTHANDLE] [ISSMTP]\n*Instance method.* Print the body of a message to the given output handle, or to the\ncurrently-selected filehandle if none was given.\n\nAll OUTHANDLE has to be is a filehandle (possibly a glob ref), or any object that responds\nto a print() message.\n\nFatal exception raised if unable to open any of the input files, or if a part contains no\ndata, or if an unsupported encoding is encountered.\n\nISSMPT is a special option to handle SMTP mails a little more intelligently than other send\nmechanisms may require. Specifically this ensures that the last byte sent is NOT '\\n' (octal\n\\012) if the last two bytes are not '\\r\\n' (\\015\\012) as this will cause some SMTP servers\nto hang.\n\nprintheader [OUTHANDLE]\n*Instance method.* Print the header of the message to the given output handle, or to the\ncurrently-selected filehandle if none was given.\n\nAll OUTHANDLE has to be is a filehandle (possibly a glob ref), or any object that responds\nto a print() message.\n\nasstring\n*Instance method.* Return the entire message as a string, with a header and an encoded body.\n\nbodyasstring\n*Instance method.* Return the encoded body as a string. This is the portion after the header\nand the blank line.\n\n*Note:* actually prepares the body by \"printing\" to a scalar. Proof that you can hand the\n\"print*()\" methods any blessed object that responds to a print() message.\n\nheaderasstring\n*Instance method.* Return the header as a string.\n"
                },
                {
                    "name": "Sending",
                    "content": "send\nsend HOW, HOWARGS...\n*Class/instance method.* This is the principal method for sending mail, and for configuring\nhow mail will be sent.\n\n*As a class method* with a HOW argument and optional HOWARGS, it sets the default sending\nmechanism that the no-argument instance method will use. The HOW is a facility name (see\nbelow), and the HOWARGS is interpreted by the facility. The class method returns the\nprevious HOW and HOWARGS as an array.\n\nMIME::Lite->send('sendmail', \"d:\\\\programs\\\\sendmail.exe\");\n...\n$msg = MIME::Lite->new(...);\n$msg->send;\n\n*As an instance method with arguments* (a HOW argument and optional HOWARGS), sends the\nmessage in the requested manner; e.g.:\n\n$msg->send('sendmail', \"d:\\\\programs\\\\sendmail.exe\");\n\n*As an instance method with no arguments,* sends the message by the default mechanism set up\nby the class method. Returns whatever the mail-handling routine returns: this should be true\non success, false/exception on error:\n\n$msg = MIME::Lite->new(From=>...);\n$msg->send || die \"you DON'T have mail!\";\n\nOn Unix systems (or rather non-Win32 systems), the default setting is equivalent to:\n\nMIME::Lite->send(\"sendmail\", \"/usr/lib/sendmail -t -oi -oem\");\n\nOn Win32 systems the default setting is equivalent to:\n\nMIME::Lite->send(\"smtp\");\n\nThe assumption is that on Win32 your site/lib/Net/libnet.cfg file will be preconfigured to\nuse the appropriate SMTP server. See below for configuring for authentication.\n\nThere are three facilities:\n\n\"sendmail\", ARGS...\nSend a message by piping it into the \"sendmail\" command. Uses the sendbysendmail()\nmethod, giving it the ARGS. This usage implements (and deprecates) the sendmail()\nmethod.\n\n\"smtp\", [HOSTNAME, [NAMEDPARMS] ]\nSend a message by SMTP, using optional HOSTNAME as SMTP-sending host. Net::SMTP will be\nrequired. Uses the sendbysmtp() method. Any additional arguments passed in will also\nbe passed through to sendbysmtp. This is useful for things like mail servers requiring\nauthentication where you can say something like the following\n\nMIME::Lite->send('smtp', $host, AuthUser=>$user, AuthPass=>$pass);\n\nwhich will configure things so future uses of\n\n$msg->send();\n\ndo the right thing.\n\n\"sub\", \\&SUBREF, ARGS...\nSends a message MSG by invoking the subroutine SUBREF of your choosing, with MSG as the\nfirst argument, and ARGS following.\n\n*For example:* let's say you're on an OS which lacks the usual Unix \"sendmail\" facility, but\nyou've installed something a lot like it, and you need to configure your Perl script to use\nthis \"sendmail.exe\" program. Do this following in your script's setup:\n\nMIME::Lite->send('sendmail', \"d:\\\\programs\\\\sendmail.exe\");\n\nThen, whenever you need to send a message $msg, just say:\n\n$msg->send;\n\nThat's it. Now, if you ever move your script to a Unix box, all you need to do is change\nthat line in the setup and you're done. All of your $msg->send invocations will work as\nexpected.\n\nAfter sending, the method lastsendsuccessful() can be used to determine if the send was\nsuccessful or not.\n\nsendbysendmail SENDMAILCMD\nsendbysendmail PARAM=>VALUE, ARRAY, HASH...\n*Instance method.* Send message via an external \"sendmail\" program (this will probably only\nwork out-of-the-box on Unix systems).\n\nReturns true on success, false or exception on error.\n\nYou can specify the program and all its arguments by giving a single string, SENDMAILCMD.\nNothing fancy is done; the message is simply piped in.\n\nHowever, if your needs are a little more advanced, you can specify zero or more of the\nfollowing PARAM/VALUE pairs (or a reference to hash or array of such arguments as well as\nany combination thereof); a Unix-style, taint-safe \"sendmail\" command will be constructed\nfor you:\n\nSendmail\nFull path to the program to use. Default is \"/usr/lib/sendmail\".\n\nBaseArgs\nRef to the basic array of arguments we start with. Default is \"[\"-t\", \"-oi\", \"-oem\"]\".\n\nSetSender\nUnless this is *explicitly* given as false, we attempt to automatically set the \"-f\"\nargument to the first address that can be extracted from the \"From:\" field of the\nmessage (if there is one).\n\n*What is the -f, and why do we use it?* Suppose we did *not* use \"-f\", and you gave an\nexplicit \"From:\" field in your message: in this case, the sendmail \"envelope\" would\nindicate the *real* user your process was running under, as a way of preventing mail\nforgery. Using the \"-f\" switch causes the sender to be set in the envelope as well.\n\n*So when would I NOT want to use it?* If sendmail doesn't regard you as a \"trusted\"\nuser, it will permit the \"-f\" but also add an \"X-Authentication-Warning\" header to the\nmessage to indicate a forged envelope. To avoid this, you can either (1) have SetSender\nbe false, or (2) make yourself a trusted user by adding a \"T\" configuration command to\nyour *sendmail.cf* file (e.g.: \"Teryq\" if the script is running as user \"eryq\").\n\nFromSender\nIf defined, this is identical to setting SetSender to true, except that instead of\nlooking at the \"From:\" field we use the address given by this option. Thus:\n\nFromSender => 'me@myhost.com'\n\nAfter sending, the method lastsendsuccessful() can be used to determine if the send was\nsuccessful or not.\n\nsendbysmtp HOST, ARGS...\nsendbysmtp REF, HOST, ARGS\n*Instance method.* Send message via SMTP, using Net::SMTP -- which will be required for this\nfeature.\n\nHOST is the name of SMTP server to connect to, or undef to have Net::SMTP use the defaults\nin Libnet.cfg.\n\nARGS are a list of key value pairs which may be selected from the list below. Many of these\nare just passed through to specific Net::SMTP commands and you should review that module for\ndetails.\n\nPlease see Good-vs-bad email addresses with sendbysmtp()\n\nHello\nLocalAddr\nLocalPort\nTimeout\nPort\nExactAddresses\nDebug\nSee Net::SMTP::new() for details.\n\nSize\nReturn\nBits\nTransaction\nEnvelope\nSee Net::SMTP::mail() for details.\n\nSkipBad\nIf true doesn't throw an error when multiple email addresses are provided and some are\nnot valid. See Net::SMTP::recipient() for details.\n\nAuthUser\nAuthenticate with Net::SMTP::auth() using this username.\n\nAuthPass\nAuthenticate with Net::SMTP::auth() using this password.\n\nNoAuth\nNormally if AuthUser and AuthPass are defined MIME::Lite will attempt to use them with\nthe Net::SMTP::auth() command to authenticate the connection, however if this value is\ntrue then no authentication occurs.\n\nTo  Sets the addresses to send to. Can be a string or a reference to an array of strings.\nNormally this is extracted from the To: (and Cc: and Bcc: fields if $AUTOCC is true).\n\nThis value overrides that.\n\nFrom\nSets the email address to send from. Normally this value is extracted from the\nReturn-Path: or From: field of the mail itself (in that order).\n\nThis value overrides that.\n\n*Returns:* True on success, croaks with an error message on failure.\n\nAfter sending, the method lastsendsuccessful() can be used to determine if the send was\nsuccessful or not.\n\nsendbytestfile FILENAME\n*Instance method.* Print message to a file (namely FILENAME), which will default to\nmailer.testfile If file exists, message will be appended.\n\nlastsendsuccessful\nThis method will return TRUE if the last send() or sendbyXXX() method call was successful.\nIt will return defined but false if it was not successful, and undefined if the object had\nnot been used to send yet.\n\nsendmail COMMAND...\n*Class method, DEPRECATED.* Declare the sender to be \"sendmail\", and set up the \"sendmail\"\ncommand. *You should use send() instead.*\n"
                },
                {
                    "name": "Miscellaneous",
                    "content": "quiet ONOFF\n*Class method.* Suppress/unsuppress all warnings coming from this module.\n\nMIME::Lite->quiet(1);       ### I know what I'm doing\n\nI recommend that you include that comment as well. And while you type it, say it out loud:\nif it doesn't feel right, then maybe you should reconsider the whole line. \";-)\"\n"
                }
            ]
        },
        "NOTES": {
            "content": "How do I prevent \"Content\" headers from showing up in my mail reader?\nApparently, some people are using mail readers which display the MIME headers like\n\"Content-disposition\", and they want MIME::Lite not to generate them \"because they look ugly\".\n\nSigh.\n\nY'know, kids, those headers aren't just there for cosmetic purposes. They help ensure that the\nmessage is *understood* correctly by mail readers. But okay, you asked for it, you got it...\nhere's how you can suppress the standard MIME headers. Before you send the message, do this:\n\n$msg->scrub;\n\nYou can scrub() any part of a multipart message independently; just be aware that it works\nrecursively. Before you scrub, note the rules that I follow:\n\nContent-type\nYou can safely scrub the \"content-type\" attribute if, and only if, the part is of type\n\"text/plain\" with charset \"us-ascii\".\n\nContent-transfer-encoding\nYou can safely scrub the \"content-transfer-encoding\" attribute if, and only if, the part\nuses \"7bit\", \"8bit\", or \"binary\" encoding. You are far better off doing this if your lines\nare under 1000 characters. Generally, that means you *can* scrub it for plain text, and you\ncan *not* scrub this for images, etc.\n\nContent-disposition\nYou can safely scrub the \"content-disposition\" attribute if you trust the mail reader to do\nthe right thing when it decides whether to show an attachment inline or as a link. Be aware\nthat scrubbing both the content-disposition and the content-type means that there is no way\nto \"recommend\" a filename for the attachment!\n\nNote: there are reports of brain-dead MUAs out there that do the wrong thing if you\n*provide* the content-disposition. If your attachments keep showing up inline or vice-versa,\ntry scrubbing this attribute.\n\nContent-length\nYou can always scrub \"content-length\" safely.\n\nHow do I give my attachment a [different] recommended filename?\nBy using the Filename option (which is different from Path!):\n\n$msg->attach(Type => \"image/gif\",\nPath => \"/here/is/the/real/file.GIF\",\nFilename => \"logo.gif\");\n\nYou should *not* put path information in the Filename.\n",
            "subsections": [
                {
                    "name": "Working with UTF-8 and other character sets",
                    "content": "All text that is added to your mail message should be properly encoded. MIME::Lite doesn't do\nthis for you. For instance, if you want to send your mail in UTF-8, where $to, $subject and\n$text have these values:\n\n*   To: \"Ramón Nuñez <foo@bar.com>\"\n\n*   Subject: \"¡Aquí está!\"\n\n*   Text: \"¿Quieres ganar muchos €'s?\"\n\nuse MIME::Lite;\nuse Encode qw(encode encodeutf8 );\n\nmy $to      = \"Ram\\363n Nu\\361ez <foo\\@bar.com>\";\nmy $subject = \"\\241Aqu\\355 est\\341!\";\nmy $text    = \"\\277Quieres ganar muchos \\x{20ac}'s?\";\n\n### Create a new message encoded in UTF-8:\nmy $msg = MIME::Lite->new(\nFrom    => 'me@myhost.com',\nTo      => encode( 'MIME-Header', $to ),\nSubject => encode( 'MIME-Header', $subject ),\nData    => encodeutf8($text)\n);\n$msg->attr( 'content-type' => 'text/plain; charset=utf-8' );\n$msg->send;\n\nNote:\n\n*   The above example assumes that the values you want to encode are in Perl's \"internal\" form,\ni.e. the strings contain decoded UTF-8 characters, not the bytes that represent those\ncharacters.\n\nSee perlunitut, perluniintro, perlunifaq and Encode for more.\n\n*   If, for the body of the email, you want to use a character set other than UTF-8, then you\nshould encode appropriately, and set the correct \"content-type\", eg:\n\n...\nData => encode('iso-8859-15',$text)\n...\n\n$msg->attr( 'content-type' => 'text/plain; charset=iso-8859-15' );\n\n*   For the message headers, Encode::MIME::Header only support UTF-8, but most modern mail\nclients should be able to handle this. It is not a problem to have your headers in a\ndifferent encoding from the message body.\n"
                },
                {
                    "name": "Benign limitations",
                    "content": "This is \"lite\", after all...\n\n*   There's no parsing. Get MIME-tools if you need to parse MIME messages.\n\n*   MIME::Lite messages are currently *not* interchangeable with either Mail::Internet or\nMIME::Entity objects. This is a completely separate module.\n\n*   A content-length field is only inserted if the encoding is binary, the message is a\nsinglepart, and all the document data is available at build() time by virtue of residing in\na simple path, or in-core. Since content-length is not a standard MIME field anyway (that's\nright, kids: it's not in the MIME RFCs, it's an HTTP thing), this seems pretty fair.\n\n*   MIME::Lite alone cannot help you lose weight. You must supplement your use of MIME::Lite\nwith a healthy diet and exercise.\n"
                },
                {
                    "name": "Cheap and easy mailing",
                    "content": "I thought putting in a default \"sendmail\" invocation wasn't too bad an idea, since a lot of\nPerlers are on UNIX systems. (As of version 3.02 this is default only on Non-Win32 boxen. On\nWin32 boxen the default is to use SMTP and the defaults specified in the\nsite/lib/Net/libnet.cfg)\n\nThe out-of-the-box configuration is:\n\nMIME::Lite->send('sendmail', \"/usr/lib/sendmail -t -oi -oem\");\n\nBy the way, these arguments to sendmail are:\n\n-t      Scan message for To:, Cc:, Bcc:, etc.\n\n-oi     Do NOT treat a single \".\" on a line as a message terminator.\nAs in, \"-oi vey, it truncated my message... why?!\"\n\n-oem    On error, mail back the message (I assume to the\nappropriate address, given in the header).\nWhen mail returns, circle is complete.  Jai Guru Deva -oem.\n\nNote that these are the same arguments you get if you configure to use the smarter, taint-safe\nmailing:\n\nMIME::Lite->send('sendmail');\n\nIf you get \"X-Authentication-Warning\" headers from this, you can forgo diddling with the\nenvelope by instead specifying:\n\nMIME::Lite->send('sendmail', SetSender=>0);\n\nAnd, if you're not on a Unix system, or if you'd just rather send mail some other way, there's\nalways SMTP, which these days probably requires authentication so you probably need to say\n\nMIME::Lite->send('smtp', \"smtp.myisp.net\",\nAuthUser=>\"YourName\",AuthPass=>\"YourPass\" );\n\nOr you can set up your own subroutine to call. In any case, check out the send() method.\n"
                }
            ]
        },
        "WARNINGS": {
            "content": "Good-vs-bad email addresses with sendbysmtp()\nIf using sendbysmtp(), be aware that unless you explicitly provide the email addresses to send\nto and from you will be forcing MIME::Lite to extract email addresses out of a possible list\nprovided in the \"To:\", \"Cc:\", and \"Bcc:\" fields. This is tricky stuff, and as such only the\nfollowing sorts of addresses will work reliably:\n\nusername\nfull.name@some.host.com\n\"Name, Full\" <full.name@some.host.com>\n\nDisclaimer: MIME::Lite was never intended to be a Mail User Agent, so please don't expect a full\nimplementation of RFC-822. Restrict yourself to the common forms of Internet addresses described\nherein, and you should be fine. If this is not feasible, then consider using MIME::Lite to\n*prepare* your message only, and using Net::SMTP explicitly to *send* your message.\n\nNote: As of MIME::Lite v3.02 the mail name extraction routines have been beefed up considerably.\nFurthermore if Mail::Address is provided then name extraction is done using that. Accordingly\nthe above advice is now less true than it once was. Funky email names *should* work properly\nnow. However the disclaimer remains. Patches welcome. :-)\n\nFormatting of headers delayed until print()\nThis class treats a MIME header in the most abstract sense, as being a collection of high-level\nattributes. The actual RFC-822-style header fields are not constructed until it's time to\nactually print the darn thing.\n\nEncoding of data delayed until print()\nWhen you specify message bodies (in build() or attach()) -- whether by FH, Data, or Path -- be\nwarned that we don't attempt to open files, read filehandles, or encode the data until print()\nis invoked.\n\nIn the past, this created some confusion for users of sendmail who gave the wrong path to an\nattachment body, since enough of the print() would succeed to get the initial part of the\nmessage out. Nowadays, $AUTOVERIFY is used to spot-check the Paths given before the mail\nfacility is employed. A whisker slower, but tons safer.\n\nNote that if you give a message body via FH, and try to print() a message twice, the second\nprint() will not do the right thing unless you explicitly rewind the filehandle.\n\nYou can get past these difficulties by using the ReadNow option, provided that you have enough\nmemory to handle your messages.\n\nMIME attributes are separate from header fields!\nImportant: the MIME attributes are stored and manipulated separately from the message header\nfields; when it comes time to print the header out, *any explicitly-given header fields override\nthe ones that would be created from the MIME attributes.* That means that this:\n\n### DANGER ### DANGER ### DANGER ### DANGER ### DANGER ###\n$msg->add(\"Content-type\", \"text/html; charset=US-ASCII\");\n\nwill set the exact \"Content-type\" field in the header I write, *regardless of what the actual\nMIME attributes are.*\n\n*This feature is for experienced users only,* as an escape hatch in case the code that normally\nformats MIME header fields isn't doing what you need. And, like any escape hatch, it's got an\nalarm on it: MIME::Lite will warn you if you attempt to set() or replace() any MIME header\nfield. Use attr() instead.\n",
            "subsections": [
                {
                    "name": "Beware of lines consisting of a single dot",
                    "content": "Julian Haight noted that MIME::Lite allows you to compose messages with lines in the body\nconsisting of a single \".\". This is true: it should be completely harmless so long as \"sendmail\"\nis used with the -oi option (see \"Cheap and easy mailing\").\n\nHowever, I don't know if using Net::SMTP to transfer such a message is equally safe. Feedback is\nwelcomed.\n\nMy perspective: I don't want to magically diddle with a user's message unless absolutely\npositively necessary. Some users may want to send files with \".\" alone on a line; my\nwell-meaning tinkering could seriously harm them.\n\nInfinite loops may mean tainted data!\nStefan Sautter noticed a bug in 2.106 where a m//gc match was failing due to tainted data,\nleading to an infinite loop inside MIME::Lite.\n\nI am attempting to correct for this, but be advised that my fix will silently untaint the data\n(given the context in which the problem occurs, this should be benign: I've labelled the source\ncode with UNTAINT comments for the curious).\n\nSo: don't depend on taint-checking to save you from outputting tainted data in a message.\n"
                },
                {
                    "name": "Don't tweak the global configuration",
                    "content": "Global configuration variables are bad, and should go away. Until they do, please follow the\nhints with each setting on how *not* to change it.\n"
                }
            ]
        },
        "A MIME PRIMER": {
            "content": "",
            "subsections": [
                {
                    "name": "Content types",
                    "content": "The \"Type\" parameter of build() is a *content type*. This is the actual type of data you are\nsending. Generally this is a string of the form \"majortype/minortype\".\n\nHere are the major MIME types. A more-comprehensive listing may be found in RFC-2046.\n\napplication\nData which does not fit in any of the other categories, particularly data to be processed by\nsome type of application program. \"application/octet-stream\", \"application/gzip\",\n\"application/postscript\"...\n\naudio\nAudio data. \"audio/basic\"...\n\nimage\nGraphics data. \"image/gif\", \"image/jpeg\"...\n\nmessage\nA message, usually another mail or MIME message. \"message/rfc822\"...\n\nmultipart\nA message containing other messages. \"multipart/mixed\", \"multipart/alternative\"...\n\ntext\nTextual data, meant for humans to read. \"text/plain\", \"text/html\"...\n\nvideo\nVideo or video+audio data. \"video/mpeg\"...\n"
                },
                {
                    "name": "Content transfer encodings",
                    "content": "The \"Encoding\" parameter of build(). This is how the message body is packaged up for safe\ntransit.\n\nHere are the 5 major MIME encodings. A more-comprehensive listing may be found in RFC-2045.\n\n7bit\nBasically, no *real* encoding is done. However, this label guarantees that no 8-bit\ncharacters are present, and that lines do not exceed 1000 characters in length.\n\n8bit\nBasically, no *real* encoding is done. The message might contain 8-bit characters, but this\nencoding guarantees that lines do not exceed 1000 characters in length.\n\nbinary\nNo encoding is done at all. Message might contain 8-bit characters, and lines might be\nlonger than 1000 characters long.\n\nThe most liberal, and the least likely to get through mail gateways. Use sparingly, or\n(better yet) not at all.\n\nbase64\nLike \"uuencode\", but very well-defined. This is how you should send essentially binary\ninformation (tar files, GIFs, JPEGs, etc.).\n\nquoted-printable\nUseful for encoding messages which are textual in nature, yet which contain non-ASCII\ncharacters (e.g., Latin-1, Latin-2, or any other 8-bit alphabet).\n"
                }
            ]
        },
        "HELPER MODULES": {
            "content": "MIME::Lite works nicely with other certain other modules if they are present. Good to have\ninstalled are the latest MIME::Types, Mail::Address, MIME::Base64, MIME::QuotedPrint, and\nNet::SMTP. Email::Date::Format is strictly required.\n\nIf they aren't present then some functionality won't work, and other features won't be as\nefficient or up to date as they could be. Nevertheless they are optional extras.\n",
            "subsections": []
        },
        "BUNDLED GOODIES": {
            "content": "MIME::Lite comes with a number of extra files in the distribution bundle. This includes\nexamples, and utility modules that you can use to get yourself started with the module.\n\nThe ./examples directory contains a number of snippets in prepared form, generally they are\ndocumented, but they should be easy to understand.\n\nThe ./contrib directory contains a companion/tool modules that come bundled with MIME::Lite,\nthey don't get installed by default. Please review the POD they come with.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "The whole reason that version 3.0 was released was to ensure that MIME::Lite is up to date and\npatched. If you find an issue please report it.\n\nAs far as I know MIME::Lite doesn't currently have any serious bugs, but my usage is hardly\ncomprehensive.\n\nHaving said that there are a number of open issues for me, mostly caused by the progress in the\ncommunity as whole since Eryq last released. The tests are based around an interesting but non\nstandard test framework. I'd like to change it over to using Test::More.\n\nShould tests fail please review the ./testout directory, and in any bug reports please include\nthe output of the relevant file. This is the only redeeming feature of not using Test::More that\nI can see.\n\nBug fixes / Patches / Contribution are welcome, however I probably won't apply them unless they\nalso have an associated test. This means that if I don't have the time to write the test the\npatch won't get applied, so please, include tests for any patches you provide.\n",
            "subsections": []
        },
        "VERSION": {
            "content": "Version: 3.033\n",
            "subsections": []
        },
        "CHANGE LOG": {
            "content": "Moved to ./changes.pod\n\nNOTE: Users of the \"advanced features\" of 3.010x smtp sending should take care: These features\nhave been REMOVED as they never really fit the purpose of the module. Redundant SMTP delivery is\na task that should be handled by another module.\n",
            "subsections": []
        },
        "TERMS AND CONDITIONS": {
            "content": "Copyright (c) 1997 by Eryq.\nCopyright (c) 1998 by ZeeGee Software Inc.\nCopyright (c) 2003,2005 Yves Orton. (demerphq)\n\nAll rights reserved. This program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n\nThis software comes with NO WARRANTY of any kind. See the COPYING file in the distribution for\ndetails.\n",
            "subsections": []
        },
        "NUTRITIONAL INFORMATION": {
            "content": "For some reason, the US FDA says that this is now required by law on any products that bear the\nname \"Lite\"...\n\nVersion 3.0 is now new and improved! The distribution is now 30% smaller!\n\nMIME::Lite                |\n------------------------------------------------------------\nServing size:             | 1 module\nServings per container:   | 1\nCalories:                 | 0\nFat:                      | 0g\nSaturated Fat:          | 0g\n\nWarning: for consumption by hardware only! May produce indigestion in humans if taken\ninternally.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Eryq (eryq@zeegee.com). President, ZeeGee Software Inc. (http://www.zeegee.com).\n\nGo to http://www.cpan.org for the latest downloads and on-line documentation for this module.\nEnjoy.\n\nPatches And Maintenance by Yves Orton and many others. Consult ./changes.pod\n",
            "subsections": []
        }
    },
    "summary": "MIME::Lite - low-calorie MIME generator  WAIT! MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else.",
    "flags": [],
    "examples": [
        "$msg = MIME::Lite->new(",
        "From     =>'me@myhost.com',",
        "To       =>'you@yourhost.com',",
        "Cc       =>'some@other.com, some@more.com',",
        "Subject  =>'Helloooooo, nurse!',",
        "Data     =>\"How's it goin', eh?\"",
        ");",
        "$msg = MIME::Lite->new(",
        "From     =>'me@myhost.com',",
        "To       =>'you@yourhost.com',",
        "Cc       =>'some@other.com, some@more.com',",
        "Subject  =>'Helloooooo, nurse!',",
        "Type     =>'image/gif',",
        "Encoding =>'base64',",
        "Path     =>'hellonurse.gif'",
        ");",
        "### Create the multipart \"container\":",
        "$msg = MIME::Lite->new(",
        "From    =>'me@myhost.com',",
        "To      =>'you@yourhost.com',",
        "Cc      =>'some@other.com, some@more.com',",
        "Subject =>'A message with 2 parts...',",
        "Type    =>'multipart/mixed'",
        ");",
        "### Add the text message part:",
        "### (Note that \"attach\" has same arguments as \"new\"):",
        "$msg->attach(",
        "Type     =>'TEXT',",
        "Data     =>\"Here's the GIF file you wanted\"",
        ");",
        "### Add the image part:",
        "$msg->attach(",
        "Type        =>'image/gif',",
        "Path        =>'aaa000123.gif',",
        "Filename    =>'logo.gif',",
        "Disposition => 'attachment'",
        ");",
        "This will create a multipart message exactly as above, but using the \"attach to singlepart\"",
        "hack:",
        "### Start with a simple text message:",
        "$msg = MIME::Lite->new(",
        "From    =>'me@myhost.com',",
        "To      =>'you@yourhost.com',",
        "Cc      =>'some@other.com, some@more.com',",
        "Subject =>'A message with 2 parts...',",
        "Type    =>'TEXT',",
        "Data    =>\"Here's the GIF file you wanted\"",
        ");",
        "### Attach a part... the make the message a multipart automatically:",
        "$msg->attach(",
        "Type     =>'image/gif',",
        "Path     =>'aaa000123.gif',",
        "Filename =>'logo.gif'",
        ");",
        "### Create a standalone part:",
        "$part = MIME::Lite->new(",
        "Top      => 0,",
        "Type     =>'text/html',",
        "Data     =>'<H1>Hello</H1>',",
        ");",
        "$part->attr('content-type.charset' => 'UTF-8');",
        "$part->add('X-Comment' => 'A message for you');",
        "### Attach it to any message:",
        "$msg->attach($part);",
        "### Write it to a filehandle:",
        "$msg->print(\\*STDOUT);",
        "### Write just the header:",
        "$msg->printheader(\\*STDOUT);",
        "### Write just the encoded body:",
        "$msg->printbody(\\*STDOUT);",
        "### Get entire message as a string:",
        "$str = $msg->asstring;",
        "### Get just the header:",
        "$str = $msg->headerasstring;",
        "### Get just the encoded body:",
        "$str = $msg->bodyasstring;",
        "### Send in the \"best\" way (the default is to use \"sendmail\"):",
        "$msg->send;",
        "Send an HTML document... with images included!",
        "$msg = MIME::Lite->new(",
        "To      =>'you@yourhost.com',",
        "Subject =>'HTML with in-line images!',",
        "Type    =>'multipart/related'",
        ");",
        "$msg->attach(",
        "Type => 'text/html',",
        "Data => qq{",
        "<body>",
        "Here's <i>my</i> image:",
        "<img src=\"cid:myimage.gif\">",
        "</body>",
        "},",
        ");",
        "$msg->attach(",
        "Type => 'image/gif',",
        "Id   => 'myimage.gif',",
        "Path => '/path/to/somefile.gif',",
        ");",
        "$msg->send();",
        "### Do something like this in your 'main':",
        "if ($IDONTHAVESENDMAIL) {",
        "MIME::Lite->send('smtp', $host, Timeout=>60,",
        "AuthUser=>$user, AuthPass=>$pass);",
        "### Now this will do the right thing:",
        "$msg->send;         ### will now use Net::SMTP as shown above"
    ],
    "see_also": []
}