home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _51631cecee4e54126b453e1d5f8d21df < prev    next >
Text File  |  2000-03-23  |  42KB  |  978 lines

  1.  
  2. <HTML>
  3. <HEAD>
  4. <TITLE>MIME::Lite - low-calorie MIME generator</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
  6. <LINK REV="made" HREF="mailto:">
  7. </HEAD>
  8.  
  9. <BODY>
  10. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  11. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  12. <STRONG><P CLASS=block> MIME::Lite - low-calorie MIME generator</P></STRONG>
  13. </TD></TR>
  14. </TABLE>
  15.  
  16. <A NAME="__index__"></A>
  17. <!-- INDEX BEGIN -->
  18.  
  19. <UL>
  20.  
  21.     <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
  22.  
  23.     <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
  24.     <LI><A HREF="#description">DESCRIPTION</A></LI>
  25.     <LI><A HREF="#more examples">MORE EXAMPLES</A></LI>
  26.     <LI><A HREF="#public interface">PUBLIC INTERFACE</A></LI>
  27.     <UL>
  28.  
  29.         <LI><A HREF="#construction">Construction</A></LI>
  30.         <LI><A HREF="#setting/getting headers and attributes">Setting/getting headers and attributes</A></LI>
  31.         <LI><A HREF="#setting/getting message data">Setting/getting message data</A></LI>
  32.         <LI><A HREF="#output">Output</A></LI>
  33.         <LI><A HREF="#sending">Sending</A></LI>
  34.         <LI><A HREF="#miscellaneous">Miscellaneous</A></LI>
  35.     </UL>
  36.  
  37.     <LI><A HREF="#notes">NOTES</A></LI>
  38.     <UL>
  39.  
  40.         <LI><A HREF="#limitations">Limitations</A></LI>
  41.         <LI><A HREF="#cheap and easy mailing">Cheap and easy mailing</A></LI>
  42.         <LI><A HREF="#under the hood">Under the hood</A></LI>
  43.     </UL>
  44.  
  45.     <LI><A HREF="#warnings">WARNINGS</A></LI>
  46.     <LI><A HREF="#a mime primer">A MIME PRIMER</A></LI>
  47.     <UL>
  48.  
  49.         <LI><A HREF="#content types">Content types</A></LI>
  50.         <LI><A HREF="#content transfer encodings">Content transfer encodings</A></LI>
  51.     </UL>
  52.  
  53.     <LI><A HREF="#change log">CHANGE LOG</A></LI>
  54.     <LI><A HREF="#terms and conditions">TERMS AND CONDITIONS</A></LI>
  55.     <LI><A HREF="#nutritional information">NUTRITIONAL INFORMATION</A></LI>
  56.     <LI><A HREF="#author">AUTHOR</A></LI>
  57. </UL>
  58. <!-- INDEX END -->
  59.  
  60. <HR>
  61. <P>
  62. <H1><A NAME="name">NAME</A></H1>
  63. <P>MIME::Lite - low-calorie MIME generator</P>
  64. <P>
  65. <HR>
  66. <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
  67. <UL>
  68. <LI>Linux</LI>
  69. <LI>Solaris</LI>
  70. <LI>Windows</LI>
  71. </UL>
  72. <HR>
  73. <H1><A NAME="synopsis">SYNOPSIS</A></H1>
  74. <PRE>
  75.     use MIME::Lite;
  76. </PRE>
  77. <PRE>
  78.  
  79. Create a single-part message:</PRE>
  80. <PRE>
  81.     # Create a new single-part message, to send a GIF file:
  82.     $msg = new MIME::Lite 
  83.                 From     =>'me@myhost.com',
  84.                 To       =>'you@yourhost.com',
  85.                 Cc       =>'some@other.com, some@more.com',
  86.                 Subject  =>'Helloooooo, nurse!',
  87.                 Type     =>'image/gif',
  88.                 Encoding =>'base64',
  89.                 Path     =>'hellonurse.gif';</PRE>
  90. <P>Create a multipart message (i.e., one with attachments):</P>
  91. <PRE>
  92.     # Create a new multipart message:
  93.     $msg = new MIME::Lite 
  94.                 From    =>'me@myhost.com',
  95.                 To      =>'you@yourhost.com',
  96.                 Cc      =>'some@other.com, some@more.com',
  97.                 Subject =>'A message with 2 parts...',
  98.                 Type    =>'multipart/mixed';
  99. </PRE>
  100. <PRE>
  101.  
  102.     # Add parts (each "attach" has same arguments as "new"):
  103.     attach $msg 
  104.                 Type     =>'TEXT',   
  105.                 Data     =>"Here's the GIF file you wanted";  
  106.     attach $msg 
  107.                 Type     =>'image/gif',
  108.                 Path     =>'aaa000123.gif',
  109.                 Filename =>'logo.gif';</PRE>
  110. <P>Output a message:</P>
  111. <PRE>
  112.     # Format as a string:
  113.     $str = $msg->as_string;
  114. </PRE>
  115. <PRE>
  116.  
  117.     # Print to a filehandle (say, a "sendmail" stream):
  118.     $msg->print(\*SENDMAIL);</PRE>
  119. <P>Send a message:</P>
  120. <PRE>
  121.     # Send in the "best" way (the default is to use "sendmail"):
  122.     $msg->send;</PRE>
  123. <P>
  124. <HR>
  125. <H1><A NAME="description">DESCRIPTION</A></H1>
  126. <P>In the never-ending quest for great taste with fewer calories,
  127. we proudly present: <EM>MIME::Lite</EM>.</P>
  128. <P>MIME::Lite is intended as a simple, standalone module for generating
  129. (not parsing!) MIME messages... specifically, it allows you to
  130. output a simple, decent single- or multi-part message with text or binary
  131. attachments.  It does not require that you have the Mail:: or MIME::
  132. modules installed.</P>
  133. <P>You can specify each message part as either the literal data itself (in
  134. a scalar or array), or as a string which can be given to <A HREF="../../../lib/Pod/perlfunc.html#item_open"><CODE>open()</CODE></A> to get
  135. a readable filehandle (e.g., ``<filename'' or ``somecommand|'').</P>
  136. <P>You don't need to worry about encoding your message data:
  137. this module will do that for you.  It handles the 5 standard MIME encodings.</P>
  138. <P>If you need more sophisticated behavior, please get the MIME-tools
  139. package instead.  I will be more likely to add stuff to that toolkit
  140. over this one.</P>
  141. <P>
  142. <HR>
  143. <H1><A NAME="more examples">MORE EXAMPLES</A></H1>
  144. <P>Create a multipart message exactly as above, but using the 
  145. ``attach to singlepart'' hack:</P>
  146. <PRE>
  147.     # Create a new multipart message:
  148.     $msg = new MIME::Lite 
  149.                 From    =>'me@myhost.com',
  150.                 To      =>'you@yourhost.com',
  151.                 Cc      =>'some@other.com, some@more.com',
  152.                 Subject =>'A message with 2 parts...',
  153.                 Type    =>'TEXT',
  154.                 Data    =>"Here's the GIF file you wanted";  
  155. </PRE>
  156. <PRE>
  157.  
  158.     # Attach a part:
  159.     attach $msg Type     =>'image/gif',
  160.                 Path     =>'aaa000123.gif',
  161.                 Filename =>'logo.gif';</PRE>
  162. <P>Output a message to a filehandle:</P>
  163. <PRE>
  164.     # Write it to a filehandle:
  165.     $msg->print(\*STDOUT); 
  166. </PRE>
  167. <PRE>
  168.  
  169.     # Write just the header:
  170.     $msg->print_header(\*STDOUT);</PRE>
  171. <PRE>
  172.  
  173.     # Write just the encoded body:
  174.     $msg->print_body(\*STDOUT);</PRE>
  175. <P>Get a message as a string:</P>
  176. <PRE>
  177.     # Get entire message as a string:
  178.     $str = $msg->as_string;
  179. </PRE>
  180. <PRE>
  181.  
  182.     # Get just the header:
  183.     $str = $msg->header_as_string;</PRE>
  184. <PRE>
  185.  
  186.     # Get just the encoded body:
  187.     $str = $msg->body_as_string;</PRE>
  188. <P>Change how messages are sent:</P>
  189. <PRE>
  190.     # Do something like this in your 'main':
  191.     if ($I_DONT_HAVE_SENDMAIL) {
  192.        MIME::Lite->send('smtp', "smtp.myisp.net", Timeout=>60);
  193.     }
  194. </PRE>
  195. <PRE>
  196.  
  197.     # Now this will do the right thing:
  198.     $msg->send;         # will now use Net::SMTP as shown above</PRE>
  199. <P>
  200. <HR>
  201. <H1><A NAME="public interface">PUBLIC INTERFACE</A></H1>
  202. <P>
  203. <H2><A NAME="construction">Construction</A></H2>
  204. <DL>
  205. <DT><STRONG><A NAME="item_new_%5BPARAMHASH%5D">new [PARAMHASH]</A></STRONG><BR>
  206. <DD>
  207. <EM>Class method, constructor.</EM>
  208. Create a new message object.
  209. <P>If any arguments are given, they are passed into <CODE>build()</CODE>; otherwise,
  210. just the empty object is created.</P>
  211. <P></P>
  212. <DT><STRONG><A NAME="item_attach_%5BOBJECT%7CPARAMHASH%5D">attach [OBJECT|PARAMHASH]</A></STRONG><BR>
  213. <DD>
  214. <EM>Instance method.</EM>
  215. Add a new part to this message, and return the new part.
  216. <P>You can attach a MIME::Lite OBJECT, or have it create one by specifying
  217. a PARAMHASH that will be automatically given to <CODE>new()</CODE>.</P>
  218. <P>One of the possibly-quite-useful hacks thrown into this is the 
  219. ``attach-to-singlepart'' hack: if you attempt to attach a part (let's
  220. call it ``part 1'') to a message that <EM>isn't</EM> a multipart message
  221. (the ``self'' object in this case), the following happens:</P>
  222. <UL>
  223. <LI>
  224. A new part (call it ``part 0'') is made.
  225. <P></P>
  226. <LI>
  227. The MIME attributes and data (but <EM>not</EM> the other headers)
  228. are cut from the ``self'' message, and pasted into ``part 0''.
  229. <P></P>
  230. <LI>
  231. The ``self'' is turned into a ``multipart/mixed'' message.
  232. <P></P>
  233. <LI>
  234. The new ``part 0'' is added to the ``self'', and <EM>then</EM> ``part 1'' is added.
  235. <P></P></UL>
  236. <P>One of the nice side-effects is that you can create a text message
  237. and then add zero or more attachments to it, much in the same way
  238. that a user agent like Netscape allows you to do.</P>
  239. <DT><STRONG><A NAME="item_build_%5BPARAMHASH%5D">build [PARAMHASH]</A></STRONG><BR>
  240. <DD>
  241. <EM>Class/instance method, initiallizer.</EM>
  242. Create (or initiallize) a MIME message object.  
  243. Normally, you'll use the following keys in PARAMHASH:
  244. <PRE>
  245.    * Data, FH, or Path      (either one of these, or none if multipart)
  246.    * Type                   (e.g., "image/jpeg")
  247.    * From, To, and Subject  (if this is the "top level" of a message)</PRE>
  248. <P>The PARAMHASH can contain the following keys:</P>
  249. <DL>
  250. <DT><STRONG><A NAME="item_%28fieldname%29">(fieldname)</A></STRONG><BR>
  251. <DD>
  252. Any field you want placed in the message header, taken from the
  253. standard list of header fields (you don't need to worry about case):
  254. <PRE>
  255.     Bcc           Encrypted     Received      Sender         
  256.     Cc            From          References    Subject 
  257.     Comments      Keywords      Reply-To      To 
  258.     Content-*     Message-ID    Resent-*      X-*
  259.     Date          MIME-Version  Return-Path   
  260.                   Organization</PRE>
  261. <P>To give experienced users some veto power, these fields will be set 
  262. <EM>after</EM> the ones I set... so be careful: <EM>don't set any MIME fields</EM>
  263. (like <CODE>Content-type</CODE>) unless you know what you're doing!</P>
  264. <P>To specify a fieldname that's <EM>not</EM> in the above list, even one that's
  265. identical to an option below, just give it with a trailing <CODE>":"</CODE>,
  266. like <CODE>"My-field:"</CODE>.  When in doubt, that <EM>always</EM> signals a mail 
  267. field (and it sort of looks like one too).</P>
  268. <P></P>
  269. <DT><STRONG><A NAME="item_Data">Data</A></STRONG><BR>
  270. <DD>
  271. <EM>Alternative to ``Path'' or ``FH''.</EM>
  272. The actual message data.  This may be a scalar or a ref to an array of
  273. strings; if the latter, the message consists of a simple concatenation 
  274. of all the strings in the array.
  275. <P></P>
  276. <DT><STRONG><A NAME="item_Disposition">Disposition</A></STRONG><BR>
  277. <DD>
  278. <EM>Optional.</EM>
  279. The content disposition, <CODE>"inline"</CODE> or <CODE>"attachment"</CODE>.
  280. The default is <CODE>"inline"</CODE>.
  281. <P></P>
  282. <DT><STRONG><A NAME="item_Encoding">Encoding</A></STRONG><BR>
  283. <DD>
  284. <EM>Optional.</EM>
  285. The content transfer encoding that should be used to encode your data.  
  286. The default is <CODE>"binary"</CODE>, which means ``no encoding'': this is generally
  287. <EM>not</EM> suitable for sending anything but ASCII text files with short
  288. lines, so consider using one of the following values instead:
  289. <PRE>
  290.    Use encoding:     If your message contains:
  291.    ------------------------------------------------------------
  292.    7bit              Only 7-bit text, all lines <1000 characters
  293.    8bit              8-bit text, all lines <1000 characters
  294.    quoted-printable  8-bit text or long lines (MUCH more reliable than "8bit")
  295.    base64            Largely binary data: a GIF, a tar file, etc.</PRE>
  296. <P>Be sure to pick an appropriate encoding.  In the case of ``7bit''/``8bit'',
  297. long lines are automatically chopped to legal length; in the case of ``7bit'', 
  298. all 8-bit characters are automatically <EM>removed</EM>.  This may not be
  299. what you want, so pick your encoding well!
  300. There's a <A HREF="#a mime primer">A MIME PRIMER</A> in this document with more info.</P>
  301. <P></P>
  302. <DT><STRONG><A NAME="item_FH">FH</A></STRONG><BR>
  303. <DD>
  304. <EM>Alternative to ``Data'' or ``Path''.</EM>
  305. Filehandle containing the data, opened for reading.
  306. See ``ReadNow'' also.
  307. <P></P>
  308. <DT><STRONG><A NAME="item_Filename">Filename</A></STRONG><BR>
  309. <DD>
  310. <EM>Optional.</EM>
  311. The name of the attachment.  You can use this to supply a filename
  312. if the one in the Path is inadequate, or if you're using the Data argument.
  313. <P></P>
  314. <DT><STRONG><A NAME="item_Length">Length</A></STRONG><BR>
  315. <DD>
  316. <EM>Optional.</EM>
  317. Set the content length explicitly.  Normally, this header is automatically
  318. computed, but only under certain circumstances (see <A HREF="#limitations">Limitations</A>).
  319. <P></P>
  320. <DT><STRONG><A NAME="item_Path">Path</A></STRONG><BR>
  321. <DD>
  322. <EM>Alternative to ``Data'' or ``FH''.</EM>
  323. Path to a file containing the data... actually, it can be any open()able
  324. expression.  If it looks like a path, the last element will automatically 
  325. be treated as the filename. 
  326. See ``ReadNow'' also.
  327. <P></P>
  328. <DT><STRONG><A NAME="item_ReadNow">ReadNow</A></STRONG><BR>
  329. <DD>
  330. <EM>Optional, for use with ``Path''.</EM>
  331. If true, will open the path and slurp the contents into core now.
  332. This is useful if the Path points to a command and you don't want 
  333. to run the command over and over if outputting the message several
  334. times.  <STRONG>Fatal exception</STRONG> raised if the open fails.
  335. <P></P>
  336. <DT><STRONG><A NAME="item_Top">Top</A></STRONG><BR>
  337. <DD>
  338. <EM>Optional.</EM>
  339. If defined, indicates whether or not this is a ``top-level'' MIME message.
  340. The parts of a multipart message are <EM>not</EM> top-level.
  341. Default is true.
  342. <P></P>
  343. <DT><STRONG><A NAME="item_Type">Type</A></STRONG><BR>
  344. <DD>
  345. <EM>Optional.</EM>
  346. The MIME content type, or one of these special values (case-sensitive):
  347. <PRE>
  348.      "TEXT"   means "text/plain"
  349.      "BINARY" means "application/octet-stream"</PRE>
  350. <P>The default is <CODE>"TEXT"</CODE>.</P>
  351. <P></P></DL>
  352. <P>A picture being worth 1000 words (which
  353. is of course 2000 bytes, so it's probably more of an ``icon'' than a ``picture'',
  354. but I digress...), here are some examples:</P>
  355. <PRE>
  356.     $msg = build MIME::Lite 
  357.                From     => 'yelling@inter.com',
  358.                To       => 'stocking@fish.net',
  359.                Subject  => "Hi there!",
  360.                Type     => 'TEXT',
  361.                Encoding => '7bit',
  362.                Data     => "Just a quick note to say hi!";
  363. </PRE>
  364. <PRE>
  365.  
  366.     $msg = build MIME::Lite 
  367.                From     => 'dorothy@emerald-city.oz',
  368.                To       => 'gesundheit@edu.edu.edu',
  369.                Subject  => "A gif for U"
  370.                Type     => 'image/gif',
  371.                Path     => "/home/httpd/logo.gif";</PRE>
  372. <PRE>
  373.  
  374.     $msg = build MIME::Lite 
  375.                From     => 'laughing@all.of.us',
  376.                To       => 'scarlett@fiddle.dee.de',
  377.                Subject  => "A gzipp'ed tar file",
  378.                Type     => 'x-gzip',
  379.                Path     => "gzip < /usr/inc/somefile.tar |",
  380.                ReadNow  => 1,
  381.                Filename => "somefile.tgz";</PRE>
  382. <P>To show you what's really going on, that last example could also 
  383. have been written:</P>
  384. <PRE>
  385.     $msg = new MIME::Lite;
  386. </PRE>
  387. <PRE>
  388.  
  389.     $msg->build(Type     => 'x-gzip',
  390.                 Path     => "gzip < /usr/inc/somefile.tar |",
  391.                 ReadNow  => 1,
  392.                 Filename => "somefile.tgz");</PRE>
  393. <PRE>
  394.  
  395.     $msg->add(From    => "laughing@all.of.us");
  396.     $msg->add(To      => "scarlett@fiddle.dee.de");
  397.     $msg->add(Subject => "A gzipp'ed tar file");</PRE>
  398. </DL>
  399. <P>
  400. <H2><A NAME="setting/getting headers and attributes">Setting/getting headers and attributes</A></H2>
  401. <DL>
  402. <DT><STRONG><A NAME="item_add">add TAG,VALUE</A></STRONG><BR>
  403. <DD>
  404. Add field TAG with the given VALUE to the end of the header. 
  405. The TAG will be converted to all-lowercase, and the VALUE 
  406. will be made ``safe'' (returns will be given a trailing space).
  407. <P><STRONG>Beware:</STRONG> any MIME fields you ``add'' will override any MIME
  408. attributes I have when it comes time to output those fields.
  409. Normally, you will use this method to add <EM>non-MIME</EM> fields:</P>
  410. <PRE>
  411.     $msg->add("Subject" => "Hi there!");</PRE>
  412. <P>Giving VALUE an arrayref will cause all those values to be added:</P>
  413. <PRE>
  414.     $msg->add("Received" => ["here", "there", "everywhere"]</PRE>
  415. <P><EM>Note:</EM> <A HREF="#item_add"><CODE>add()</CODE></A> is probably going to be more efficient than <A HREF="#item_replace"><CODE>replace()</CODE></A>,
  416. so you're better off using it for most applications.</P>
  417. <P><EM>Note:</EM> the name comes from Mail::Header.</P>
  418. <P></P>
  419. <DT><STRONG><A NAME="item_attr_ATTR%2C%5BVALUE%5D">attr ATTR,[VALUE]</A></STRONG><BR>
  420. <DD>
  421. Set MIME attribute ATTR to the string VALUE.  
  422. ATTR is converted to all-lowercase.
  423. This method is normally used to set/get MIME attributes:
  424. <PRE>
  425.     $msg->attr("content-type"         => "text/html");
  426.     $msg->attr("content-type.charset" => "US-ASCII");
  427.     $msg->attr("content-type.name"    => "homepage.html");</PRE>
  428. <P>This would cause the final output to look something like this:</P>
  429. <PRE>
  430.     Content-type: text/html; charset=US-ASCII; name="homepage.html"</PRE>
  431. <P>Note that the special empty sub-field tag indicates the anonymous 
  432. first sub-field.</P>
  433. <P>Giving VALUE as undefined will cause the contents of the named
  434. subfield to be deleted.</P>
  435. <P>Supplying no VALUE argument just returns the attribute's value:</P>
  436. <PRE>
  437.     $type = $msg->attr("content-type");        # returns "text/html"
  438.     $name = $msg->attr("content-type.name");   # returns "homepage.html"</PRE>
  439. <P></P>
  440. <DT><STRONG><A NAME="item_delete">delete TAG</A></STRONG><BR>
  441. <DD>
  442. Delete field TAG with the given VALUE to the end of the header.  
  443. The TAG will be converted to all-lowercase.
  444. <PRE>
  445.     $msg->delete("Subject");</PRE>
  446. <P><EM>Note:</EM> the name comes from Mail::Header.</P>
  447. <P></P>
  448. <DT><STRONG><A NAME="item_fields">fields</A></STRONG><BR>
  449. <DD>
  450. Return the full header for the object, as a ref to an array
  451. of <CODE>[TAG, VALUE]</CODE> pairs.
  452. <P>Any fields that the user has explicitly set will override the
  453. corresponding MIME fields that we would generate.  So: <EM>don't</EM> say:</P>
  454. <PRE>
  455.     $msg->set("Content-type" => "text/html; charset=US-ASCII");</PRE>
  456. <P>unless you <EM>mean it</EM>!</P>
  457. <P><EM>Note:</EM> I called this ``fields'' because the <CODE>header()</CODE> method of
  458. Mail::Header returns something different, but similar enough to 
  459. be confusing.</P>
  460. <P></P>
  461. <DT><STRONG><A NAME="item_filename_%5BFILENAME%5D">filename [FILENAME]</A></STRONG><BR>
  462. <DD>
  463. Set the filename which this data will be reported as.
  464. This actually sets both ``standard'' attributes.
  465. <P>With no argument, returns the filename as dictated by the 
  466. content-disposition.</P>
  467. <P></P>
  468. <DT><STRONG><A NAME="item_get_TAG%2C%5BINDEX%5D">get TAG,[INDEX]</A></STRONG><BR>
  469. <DD>
  470. Get the contents of field TAG, which might have been set 
  471. with <CODE>set()</CODE> or replace().  Returns the text of the field.
  472. <PRE>
  473.     $ml->get('Subject', 0);</PRE>
  474. <P>If the optional 0-based INDEX is given, then we return the INDEX'th
  475. occurence of field TAG.  Otherwise, we look at the context:
  476. In a scalar context, only the first (0th) occurence of the 
  477. field is returned; in an array context, <EM>all</EM> occurences are returned.</P>
  478. <P><EM>Warning:</EM> this should only be used with non-MIME fields.
  479. Behavior with MIME fields is TBD, and will raise an exception for now.</P>
  480. <P></P>
  481. <DT><STRONG><A NAME="item_get_length">get_length</A></STRONG><BR>
  482. <DD>
  483. Recompute the content length for the message <EM>if the process is trivial</EM>, 
  484. setting the ``content-length'' attribute as a side-effect:
  485. <PRE>
  486.     $msg->get_length;</PRE>
  487. <P>Returns the length, or undefined if not set.</P>
  488. <P><EM>Note:</EM> the content length can be difficult to compute, since it 
  489. involves assembling the entire encoded body and taking the length
  490. of it (which, in the case of multipart messages, means freezing
  491. all the sub-parts, etc.).</P>
  492. <P>This method only sets the content length to a defined value if the
  493. message is a singlepart with <CODE>"binary"</CODE> encoding, <EM>and</EM> the body is
  494. available either in-core or as a simple file.  Otherwise, the content
  495. length is set to the undefined value.</P>
  496. <P>Since content-length is not a standard MIME field anyway (that's right, kids:
  497. it's not in the MIME RFCs, it's an HTTP thing), this seems pretty fair.</P>
  498. <P></P>
  499. <DT><STRONG><A NAME="item_replace">replace TAG,VALUE</A></STRONG><BR>
  500. <DD>
  501. Delete all occurences of fields named TAG, and add a new
  502. field with the given VALUE.  TAG is converted to all-lowercase.
  503. <P><STRONG>Beware:</STRONG> any MIME fields you ``replace'' will override any MIME
  504. attributes I have when it comes time to output those fields.
  505. Normally, you will use this method to set <EM>non-MIME</EM> fields:</P>
  506. <PRE>
  507.     $msg->replace("Subject" => "Hi there!");</PRE>
  508. <P>Giving VALUE as undefined will simply cause the contents of the named
  509. field to be deleted.  Giving VALUE as an arrayref will cause all the values
  510. in the array to be added.</P>
  511. <P><EM>Note:</EM> the name comes from Mail::Header.</P>
  512. <P></P></DL>
  513. <P>
  514. <H2><A NAME="setting/getting message data">Setting/getting message data</A></H2>
  515. <DL>
  516. <DT><STRONG><A NAME="item_binmode_%5BOVERRIDE%5D">binmode [OVERRIDE]</A></STRONG><BR>
  517. <DD>
  518. With no argument, returns whether or not it thinks that the data 
  519. (as given by the ``Path'' argument of <CODE>build()</CODE>) should be read using 
  520. <A HREF="../../../lib/Pod/perlfunc.html#item_binmode"><CODE>binmode()</CODE></A> (for example, when <A HREF="#item_read_now"><CODE>read_now()</CODE></A> is invoked).
  521. <P>The default behavior is that any content type other than 
  522. <CODE>text/*</CODE> or <CODE>message/*</CODE> is binmode'd; this should in general work fine.</P>
  523. <P>With a defined argument, this method sets an explicit ``override''
  524. value.  An undefined argument unsets the override.
  525. The new current value is returned.</P>
  526. <P></P>
  527. <DT><STRONG><A NAME="item_data_%5BDATA%5D">data [DATA]</A></STRONG><BR>
  528. <DD>
  529. Get/set the literal DATA of the message.  The DATA may be
  530. either a scalar, or a reference to an array of scalars (which
  531. will simply be joined).
  532. <P><EM>Warning:</EM> setting the data causes the ``content-length'' attribute
  533. to be recomputed (possibly to nothing).</P>
  534. <P></P>
  535. <DT><STRONG><A NAME="item_path_%5BPATH%5D">path [PATH]</A></STRONG><BR>
  536. <DD>
  537. Get/set the PATH to the message data.
  538. <P><EM>Warning:</EM> setting the path recomputes any existing ``content-length'' field,
  539. and re-sets the ``filename'' (to the last element of the path if it
  540. looks like a simple path, and to nothing if not).</P>
  541. <P></P>
  542. <DT><STRONG><A NAME="item_fh_%5BFILEHANDLE%5D">fh [FILEHANDLE]</A></STRONG><BR>
  543. <DD>
  544. Get/set the FILEHANDLE which contains the message data.
  545. <P>Takes a filehandle as an input and stores it in the object.
  546. This routine is similar to path(); one important difference is that 
  547. no attempt is made to set the content length.</P>
  548. <P></P>
  549. <DT><STRONG><A NAME="item_resetfh_%5BFILEHANDLE%5D">resetfh [FILEHANDLE]</A></STRONG><BR>
  550. <DD>
  551. Set the current position of the filehandle back to the beginning. 
  552. Only applies if you used ``FH'' in <CODE>build()</CODE> or <CODE>attach()</CODE> for this message.
  553. <P>Returns false if unable to reset the filehandle (since not all filehandles
  554. are seekable).</P>
  555. <P></P>
  556. <DT><STRONG><A NAME="item_read_now">read_now</A></STRONG><BR>
  557. <DD>
  558. Forces data from the path/filehandle (as specified by <CODE>build()</CODE>)
  559. to be read into core immediately, just as though you had given it
  560. literally with the <A HREF="#item_Data"><CODE>Data</CODE></A> keyword.
  561. <P>Note that the in-core data will always be used if available.</P>
  562. <P>Be aware that everything is slurped into a giant scalar: you may not want 
  563. to use this if sending tar files!  The benefit of <EM>not</EM> reading in the data 
  564. is that very large files can be handled by this module if left on disk
  565. until the message is output via <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A> or <CODE>print_body()</CODE>.</P>
  566. <P></P>
  567. <DT><STRONG><A NAME="item_sign">sign PARAMHASH</A></STRONG><BR>
  568. <DD>
  569. Sign the message.  This forces the message to be read into core,
  570. after which the signature is appended to it.
  571. <DL>
  572. <DT><STRONG>Data</STRONG><BR>
  573. <DD>
  574. As in <CODE>build()</CODE>: the literal signature data.
  575. Can be either a scalar or a ref to an array of scalars.
  576. <P></P>
  577. <DT><STRONG>Path</STRONG><BR>
  578. <DD>
  579. As in <CODE>build()</CODE>: the path to the file.
  580. <P></P></DL>
  581. <P>If no arguments are given, the default is:</P>
  582. <PRE>
  583.     Path => "$ENV{HOME}/.signature"</PRE>
  584. <P>The content-length is recomputed.</P>
  585. </DL>
  586. <P>
  587. <H2><A NAME="output">Output</A></H2>
  588. <DL>
  589. <DT><STRONG><A NAME="item_print_%5BOUTHANDLE%5D">print [OUTHANDLE]</A></STRONG><BR>
  590. <DD>
  591. <EM>Instance method.</EM> 
  592. Print the message to the given output handle, or to the currently-selected
  593. filehandle if none was given.
  594. <P>All OUTHANDLE has to be is a filehandle (possibly a glob ref), or 
  595. any object that responds to a <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A> message.</P>
  596. <P></P>
  597. <DT><STRONG><A NAME="item_print_body_%5BOUTHANDLE%5D">print_body [OUTHANDLE]</A></STRONG><BR>
  598. <DD>
  599. <EM>Instance method.</EM> 
  600. Print the body of the message to the given output handle, 
  601. or to the currently-selected filehandle if none was given.
  602. <P>All OUTHANDLE has to be is a filehandle (possibly a glob ref), or 
  603. any object that responds to a <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A> message.</P>
  604. <P><STRONG>Fatal exception</STRONG> raised if unable to open any of the input files,
  605. or if a part contains no data, or if an unsupported encoding is 
  606. encountered.</P>
  607. <P></P>
  608. <DT><STRONG><A NAME="item_print_header_%5BOUTHANDLE%5D">print_header [OUTHANDLE]</A></STRONG><BR>
  609. <DD>
  610. <EM>Instance method.</EM> 
  611. Print the header of the message to the given output handle, 
  612. or to the currently-selected filehandle if none was given.
  613. <P>All OUTHANDLE has to be is a filehandle (possibly a glob ref), or 
  614. any object that responds to a <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A> message.</P>
  615. <P></P>
  616. <DT><STRONG><A NAME="item_as_string">as_string</A></STRONG><BR>
  617. <DD>
  618. <EM>Instance method.</EM> 
  619. Return the entire message as a string, with a header and an encoded body.
  620. <P></P>
  621. <DT><STRONG><A NAME="item_body_as_string">body_as_string</A></STRONG><BR>
  622. <DD>
  623. <EM>Instance method.</EM> 
  624. Return the encoded body as a string.
  625. <P><EM>Note:</EM> actually prepares the body by ``printing'' to a scalar.
  626. Proof that you can hand the <CODE>print*()</CODE> methods any blessed object 
  627. that responds to a <A HREF="../../../lib/Pod/perlfunc.html#item_print"><CODE>print()</CODE></A> message.</P>
  628. <P></P>
  629. <DT><STRONG><A NAME="item_header_as_string">header_as_string</A></STRONG><BR>
  630. <DD>
  631. <EM>Instance method.</EM> 
  632. Return the header as a string.
  633. <P></P></DL>
  634. <P>
  635. <H2><A NAME="sending">Sending</A></H2>
  636. <DL>
  637. <DT><STRONG><A NAME="item_send">send</A></STRONG><BR>
  638. <DD>
  639. <DT><STRONG><A NAME="item_send_HOW%2C_HOWARGS%2E%2E%2E">send HOW, HOWARGS...</A></STRONG><BR>
  640. <DD>
  641. <EM>Class/instance method.</EM>  
  642. This is the principle method for sending mail, and for configuring
  643. how mail will be sent.
  644. <P><EM>As an instance method</EM> (with no arguments), sends the message by whatever 
  645. means has been set up (the default is to use the Unix ``sendmail'' program).
  646. Returns whatever the mail-handling routine returns: this should be true 
  647. on success, false/exception on error:</P>
  648. <PRE>
  649.     $msg = MIME::Lite->new(From=>...);
  650.     $msg->send || die "you DON'T have mail!";</PRE>
  651. <P><EM>As a class method</EM> (with a HOW argument and optional HOWARGS), sets up 
  652. how the instance method will work for all objects until further notice.
  653. It treats HOW as a facility name, with optional HOWARGS handled by
  654. the facility.   There are three facilities:</P>
  655. <DL>
  656. <DT><STRONG><A NAME="item_%22sendmail%22%2C_SENDMAILCMD">``sendmail'', SENDMAILCMD</A></STRONG><BR>
  657. <DD>
  658. Send a message by piping it into the ``sendmail'' command.
  659. Uses the <CODE>send_by_sendmail()</CODE> method, giving it the SENDMAILCMD.
  660. This usage implements (and deprecates) the <CODE>sendmail()</CODE> method.
  661.  
  662. <PRE>
  663.  
  664. =item "smtp", [HOSTNAME]</PRE>
  665. <P>Send a message by SMTP, using optional HOSTNAME as SMTP-sending host.
  666. Uses the <CODE>send_by_smtp()</CODE> method.</P>
  667. <P></P>
  668. <DT><STRONG><A NAME="item_%22sub%22%2C_%5C%26SUBREF%2C_ARGS%2E%2E%2E">``sub'', \&SUBREF, ARGS...</A></STRONG><BR>
  669. <DD>
  670. Sends a message MSG by invoking the subroutine SUBREF of your choosing,
  671. with MSG as the first argument, and ARGS following.
  672. <P></P></DL>
  673. <P><EM>For example:</EM> let's say you're on an OS which lacks the usual Unix
  674. ``sendmail'' facility, but you've installed something a lot like it, and
  675. you need to configure your Perl script to use this ``sendmail.exe'' program.
  676. Do this following in your script's setup:</P>
  677. <PRE>
  678.     MIME::Lite->send('sendmail', "d:\\programs\\sendmail.exe");</PRE>
  679. <P>Then, whenever you need to send a message $msg, just say:</P>
  680. <PRE>
  681.     $msg->send;</PRE>
  682. <P>That's it.  Now, if you ever move your script to a Unix box, all you
  683. need to do is change that line in the setup and you're done.
  684. All of your $msg->send invocations will work as expected.</P>
  685. <DT><STRONG><A NAME="item_send_by_sendmail_SENDMAILCMD">send_by_sendmail SENDMAILCMD</A></STRONG><BR>
  686. <DD>
  687. <EM>Instance method.</EM>
  688. Send message via the external ``sendmail'' program, SENDMAILCMD.
  689. Returns true on success, false or exception on error.
  690. <P><EM>Note:</EM> this facility will probably only work on Unix systems.
  691. The SENDMAILCMD for this facility must get all its message-specific 
  692. information from the standard input.</P>
  693. <P></P>
  694. <DT><STRONG><A NAME="item_send_by_smtp_%5BARGS%2E%2E%2E%5D">send_by_smtp [ARGS...]</A></STRONG><BR>
  695. <DD>
  696. <EM>Instance method.</EM>
  697. Send message via SMTP, using Net::SMTP.  
  698. The ARGS are sent into Net::SMTP::new(): usually, these are
  699. <PRE>
  700.     MAILHOST, OPTION=>VALUE, ...</PRE>
  701. <P>Returns true on success, false or exception on error.</P>
  702. <P></P>
  703. <DT><STRONG><A NAME="item_sendmail_COMMAND%2E%2E%2E">sendmail COMMAND...</A></STRONG><BR>
  704. <DD>
  705. <EM>Class method, DEPRECATED.</EM>  
  706. Declare the sender to be ``sendmail'', and set up the ``sendmail'' command.
  707. <EM>You should use send() instead.</EM>
  708. <P></P></DL>
  709. <P>
  710. <H2><A NAME="miscellaneous">Miscellaneous</A></H2>
  711. <DL>
  712. <DT><STRONG><A NAME="item_quiet">quiet ONOFF</A></STRONG><BR>
  713. <DD>
  714. <EM>Class method.</EM>  
  715. Suppress/unsuppress all warnings coming from this module.
  716. <PRE>
  717.     quiet MIME::Lite 1;       # I know what I'm doing</PRE>
  718. <P>I recommend that you include that comment as well.  And while
  719. you type it, say it out loud: if it doesn't feel right, then maybe
  720. you should reconsider the whole line.  <CODE>;-)</CODE></P>
  721. <P></P></DL>
  722. <P>
  723. <HR>
  724. <H1><A NAME="notes">NOTES</A></H1>
  725. <P>
  726. <H2><A NAME="limitations">Limitations</A></H2>
  727. <P>This is ``lite'', after all...</P>
  728. <UL>
  729. <LI>
  730. There's no parsing.  Get MIME-tools if you need to parse MIME messages.
  731. <P></P>
  732. <LI>
  733. MIME::Lite messages are currently <EM>not</EM> interchangeable with 
  734. either Mail::Internet or MIME::Entity objects.  This is a completely 
  735. separate module.
  736. <P></P>
  737. <LI>
  738. A content-length field is only inserted if the encoding is binary,
  739. the message is a singlepart, and all the document data is available
  740. at <CODE>build()</CODE> time by virtue of residing in a simple path, or in-core.
  741. Since content-length is not a standard MIME field anyway (that's right, kids:
  742. it's not in the MIME RFCs, it's an HTTP thing), this seems pretty fair.
  743. <P></P>
  744. <LI>
  745. MIME::Lite alone cannot help you lose weight.  You must supplement
  746. your use of MIME::Lite with a healthy diet and exercise.
  747. <P></P></UL>
  748. <P>
  749. <H2><A NAME="cheap and easy mailing">Cheap and easy mailing</A></H2>
  750. <P>I thought putting in a default ``sendmail'' invocation wasn't too bad an 
  751. idea, since a lot of Perlers are on UNIX systems.  The default arguments
  752. to sendmail (which you can change) are:</P>
  753. <PRE>
  754.      -t      Scan message for To:, Cc:, Bcc:, etc.
  755. </PRE>
  756. <PRE>
  757.  
  758.      -oi     Do NOT treat a single "." on a line as a message terminator.
  759.              As in, "-oi vey, it truncated my message... why?!"</PRE>
  760. <PRE>
  761.  
  762.      -oem    On error, mail back the message (I assume to the
  763.              appropriate address, given in the header).
  764.              When mail returns, circle is complete.  Jai guru deva -oem.</PRE>
  765. <P>If you're not on a Unix system, or if you'd just rather send mail
  766. some other way, check out the <A HREF="#item_send"><CODE>send()</CODE></A> method.  There's built in
  767. support for SMTP delivery, or you can slip in your own hooks.</P>
  768. <P>
  769. <H2><A NAME="under the hood">Under the hood</A></H2>
  770. <P>This class treats a MIME header in the most abstract sense,
  771. as being a collection of high-level attributes.  The actual
  772. RFC-822-style header fields are not constructed until it's time
  773. to actually print the darn thing.</P>
  774. <P>
  775. <HR>
  776. <H1><A NAME="warnings">WARNINGS</A></H1>
  777. <P><STRONG>Important:</STRONG> the MIME attributes are stored and manipulated separately 
  778. from the message header fields; when it comes time to print the 
  779. header out, <EM>any explicitly-given header fields override the ones that
  780. would be created from the MIME attributes.</EM>  That means that this:</P>
  781. <PRE>
  782.     ### DANGER ### DANGER ### DANGER ### DANGER ### DANGER ###
  783.     $msg->add("Content-type", "text/html; charset=US-ASCII");</PRE>
  784. <P>will set the exact <CODE>"Content-type"</CODE> field in the header I write, 
  785. <EM>regardless of what the actual MIME attributes are.</EM></P>
  786. <P><EM>This feature is for experienced users only,</EM> as an escape hatch in case
  787. the code that normally formats MIME header fields isn't doing what 
  788. you need.  And, like any escape hatch, it's got an alarm on it:
  789. MIME::Lite will warn you if you attempt to <CODE>set()</CODE> or <A HREF="#item_replace"><CODE>replace()</CODE></A>
  790. any MIME header field.  Use <CODE>attr()</CODE> instead.</P>
  791. <P>
  792. <HR>
  793. <H1><A NAME="a mime primer">A MIME PRIMER</A></H1>
  794. <P>
  795. <H2><A NAME="content types">Content types</A></H2>
  796. <P>The ``Type'' parameter of <CODE>build()</CODE> is a <EM>content type</EM>. 
  797. This is the actual type of data you are sending.  
  798. Generally this is a string of the form <CODE>"majortype/minortype"</CODE>.</P>
  799. <P>Here are the major MIME types.
  800. A more-comprehensive listing may be found in RFC-2046.</P>
  801. <DL>
  802. <DT><STRONG><A NAME="item_application">application</A></STRONG><BR>
  803. <DD>
  804. Data which does not fit in any of the other categories, particularly 
  805. data to be processed by some type of application program. 
  806. <CODE>application/octet-stream</CODE>, <CODE>application/gzip</CODE>, <CODE>application/postscript</CODE>...
  807. <P></P>
  808. <DT><STRONG><A NAME="item_audio">audio</A></STRONG><BR>
  809. <DD>
  810. Audio data.
  811. <CODE>audio/basic</CODE>...
  812. <P></P>
  813. <DT><STRONG><A NAME="item_image">image</A></STRONG><BR>
  814. <DD>
  815. Graphics data.
  816. <CODE>image/gif</CODE>, <CODE>image/jpeg</CODE>...
  817. <P></P>
  818. <DT><STRONG><A NAME="item_message">message</A></STRONG><BR>
  819. <DD>
  820. A message, usually another mail or MIME message.
  821. <CODE>message/rfc822</CODE>...
  822. <P></P>
  823. <DT><STRONG><A NAME="item_multipart">multipart</A></STRONG><BR>
  824. <DD>
  825. A message containing other messages.
  826. <CODE>multipart/mixed</CODE>, <CODE>multipart/alternative</CODE>...
  827. <P></P>
  828. <DT><STRONG><A NAME="item_text">text</A></STRONG><BR>
  829. <DD>
  830. Textual data, meant for humans to read.
  831. <CODE>text/plain</CODE>, <CODE>text/html</CODE>...
  832. <P></P>
  833. <DT><STRONG><A NAME="item_video">video</A></STRONG><BR>
  834. <DD>
  835. Video or video+audio data.
  836. <CODE>video/mpeg</CODE>...
  837. <P></P></DL>
  838. <P>
  839. <H2><A NAME="content transfer encodings">Content transfer encodings</A></H2>
  840. <P>The ``Encoding'' parameter of <CODE>build()</CODE>.
  841. This is how the message body is packaged up for safe transit.</P>
  842. <P>Here are the 5 major MIME encodings.
  843. A more-comprehensive listing may be found in RFC-2045.</P>
  844. <OL>
  845. <LI><STRONG><A NAME="item_bit">bit</A></STRONG><BR>
  846.  
  847. Basically, no <EM>real</EM> encoding is done.  However, this label guarantees that no
  848. 8-bit characters are present, and that lines do not exceed 1000 characters 
  849. in length.
  850. <P></P>
  851. <LI><STRONG>bit</STRONG><BR>
  852.  
  853. Basically, no <EM>real</EM> encoding is done.  The message might contain 8-bit 
  854. characters, but this encoding guarantees that lines do not exceed 1000 
  855. characters in length.
  856. <P></P>
  857. <DT><STRONG><A NAME="item_binary">binary</A></STRONG><BR>
  858. <DD>
  859. No encoding is done at all.  Message might contain 8-bit characters,
  860. and lines might be longer than 1000 characters long.
  861. <P>The most liberal, and the least likely to get through mail gateways.  
  862. Use sparingly, or (better yet) not at all.</P>
  863. <P></P>
  864. <DT><STRONG><A NAME="item_base64">base64</A></STRONG><BR>
  865. <DD>
  866. Like ``uuencode'', but very well-defined.  This is how you should send
  867. essentially binary information (tar files, GIFs, JPEGs, etc.).
  868. <P></P>
  869. <DT><STRONG><A NAME="item_quoted%2Dprintable">quoted-printable</A></STRONG><BR>
  870. <DD>
  871. Useful for encoding messages which are textual in nature, yet which contain 
  872. non-ASCII characters (e.g., Latin-1, Latin-2, or any other 8-bit alphabet).
  873. <P></P></OL>
  874. <P>
  875. <HR>
  876. <H1><A NAME="change log">CHANGE LOG</A></H1>
  877. <P><STRONG>Current version:</STRONG>
  878. $Id: Lite.pm,v 1.135 1999/04/18 14:32:13 eryq Exp $</P>
  879. <DL>
  880. <DT><STRONG><A NAME="item_Version_1%2E133">Version 1.133</A></STRONG><BR>
  881. <DD>
  882. Fixed bug in ``Data'' handling: arrayrefs were not being handled
  883. properly.
  884. <P></P>
  885. <DT><STRONG><A NAME="item_Version_1%2E130">Version 1.130</A></STRONG><BR>
  886. <DD>
  887. Added much larger and more-flexible <A HREF="#item_send"><CODE>send()</CODE></A> facility.
  888. <EM>Thanks to Andrew McRae (and Optimation New Zealand Ltd) 
  889. for the Net::SMTP interface.  Additional thanks to the many folks
  890. who requested this feature.</EM>
  891. <P>Added <CODE>get()</CODE> method for extracting basic attributes.</P>
  892. <P>New... ``t'' tests!</P>
  893. <P></P>
  894. <DT><STRONG><A NAME="item_Version_1%2E124">Version 1.124</A></STRONG><BR>
  895. <DD>
  896. Folded in filehandle (FH) support in build/attach.
  897. <EM>Thanks to Miko O'Sullivan for the code.</EM>
  898. <P></P>
  899. <DT><STRONG><A NAME="item_Version_1%2E122">Version 1.122</A></STRONG><BR>
  900. <DD>
  901. MIME::Base64 and MIME::QuotedPrint are used if available.
  902. <P>The 7bit encoding no longer does ``escapes''; it merely strips 8-bit characters.</P>
  903. <P></P>
  904. <DT><STRONG><A NAME="item_Version_1%2E121">Version 1.121</A></STRONG><BR>
  905. <DD>
  906. Filename attribute is now no longer ignored by build().
  907. <EM>Thanks to Ian Smith for finding and patching this bug.</EM>
  908. <P></P>
  909. <DT><STRONG><A NAME="item_Version_1%2E120">Version 1.120</A></STRONG><BR>
  910. <DD>
  911. Efficiency hack to speed up MIME::Lite::IO_Scalar.
  912. <EM>Thanks to David Aspinwall for the patch.</EM>
  913. <P></P>
  914. <DT><STRONG><A NAME="item_Version_1%2E116">Version 1.116</A></STRONG><BR>
  915. <DD>
  916. Small bug in our private copy of <CODE>encode_base64()</CODE> was patched.
  917. <EM>Thanks to Andreas Koenig for pointing this out.</EM>
  918. <P>New, prettier way of specifying mail message headers in <CODE>build()</CODE>.</P>
  919. <P>New quiet method to turn off warnings.</P>
  920. <P>Changed ``stringify'' methods to more-standard ``as_string'' methods.</P>
  921. <P></P>
  922. <DT><STRONG><A NAME="item_Version_1%2E112">Version 1.112</A></STRONG><BR>
  923. <DD>
  924. Added <A HREF="#item_read_now"><CODE>read_now()</CODE></A>, and <A HREF="../../../lib/Pod/perlfunc.html#item_binmode"><CODE>binmode()</CODE></A> method for our non-Unix-using brethren: 
  925. file data is now read using <A HREF="../../../lib/Pod/perlfunc.html#item_binmode"><CODE>binmode()</CODE></A> if appropriate.
  926. <EM>Thanks to Xiangzhou Wang for pointing out this bug.</EM>
  927. <P></P>
  928. <DT><STRONG><A NAME="item_Version_1%2E110">Version 1.110</A></STRONG><BR>
  929. <DD>
  930. Fixed bug in opening the data filehandle.
  931. <P></P>
  932. <DT><STRONG><A NAME="item_Version_1%2E102">Version 1.102</A></STRONG><BR>
  933. <DD>
  934. Initial release.
  935. <P></P>
  936. <DT><STRONG><A NAME="item_Version_1%2E101">Version 1.101</A></STRONG><BR>
  937. <DD>
  938. Baseline code.
  939. <P></P></DL>
  940. <P>
  941. <HR>
  942. <H1><A NAME="terms and conditions">TERMS AND CONDITIONS</A></H1>
  943. <P>Copyright (c) 1997 by Eryq.  
  944. Copyright (c) 1998 by ZeeGee Software Inc.
  945. All rights reserved.  This program is free software; you can redistribute 
  946. it and/or modify it under the same terms as Perl itself.</P>
  947. <P>This software comes with <STRONG>NO WARRANTY</STRONG> of any kind.
  948. See the COPYING file in the distribution for details.</P>
  949. <P>
  950. <HR>
  951. <H1><A NAME="nutritional information">NUTRITIONAL INFORMATION</A></H1>
  952. <P>For some reason, the US FDA says that this is now required by law
  953. on any products that bear the name ``Lite''...</P>
  954. <PRE>
  955.     Serving size:             1 module
  956.     Servings per container:   1
  957.     Calories:                 0
  958.     Fat:                      0g
  959.       Saturated Fat:          0g</PRE>
  960. <PRE>
  961.     Warning: for consumption by hardware only!  May produce 
  962.     indigestion in humans if taken internally.</PRE>
  963. <P>
  964. <HR>
  965. <H1><A NAME="author">AUTHOR</A></H1>
  966. <P>Eryq (<EM><A HREF="mailto:eryq@zeegee.com">eryq@zeegee.com</A></EM>).
  967. President, ZeeGee Software Inc. (<EM><A HREF="http://www.zeegee.com">http://www.zeegee.com</A></EM>).</P>
  968. <P>Created: 11 December 1996.  Ho ho ho.</P>
  969. <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  970. <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
  971. <STRONG><P CLASS=block> MIME::Lite - low-calorie MIME generator</P></STRONG>
  972. </TD></TR>
  973. </TABLE>
  974.  
  975. </BODY>
  976.  
  977. </HTML>
  978.