Index Introduction So why MIME :: Lite? MIME MIME :: Lite Global Values The new () method The build () method The attach () method attributes the add () and attr (). The method field_order () The get () method The method replace () The sign () method rendering the as_string () methods, body_as_string () and header_as_string () Sending The send () method The castle Gascon First a little order Why all this? Code rendering Explanation of MIME :: Lite and Net :: SMTP text? Conclusion References section: Notes section: rubber bumper guard Author
In the previous article, you were shown how to include in your program the send email functionality through the use of a box is simple, effective and low-level tools. However, you have seen it was not possible to do in this area, it would just do one thing well.
But of course, the solution exists on CPAN [1], the software library of Perl (and several copies). I therefore propose to continue our overview of the best qualities of this language in the field of e-mail by submitting another toolbox: MIME :: Lite. This module rubber bumper guard is one that will allow you to include something other than text in your email and user (without abusing ;-), the fastest, efficient and economic, postal services worldwide. Introduction
The first delicate operation when you want to use one of these modules "to do" in the field of e-mail is not the installation or understanding of the documentation is to make its market.
There are no fewer than three lines of modules this is the first field: can be found on the CPAN Mail :: * :: * MIME and Email :: *. The first was initiated by Graham Barr (author of libnet, including Net :: SMTP presented in the first section is a component), and the third was the goal (presumptuous?) To everyone Agreement simplifying and unifying procedures. It has only coexists with the other two.
My choice was focused on the second family. Here is an example module code that I have chosen to present you (the readers rubber bumper guard of the previous article recognize the response to our friend "me" by our other friend "you" on the evening rubber bumper guard of the latter): ! # / usr / bin / perl-w use MIME :: Lite; $ msg = MIME :: Lite -> new (From => 'toi@toncheztoi.org', To => 'moi@monchezmoi.org' Cc => 'lautre@sonchezlui.org', Subject => "Re: Last night", Data => "I'll tell you ... \ n \ nToi.") $ msg -> send;
There is a degree of subjectivity. When I flew the documentation of the three families of modules and in particular modules I would need is the approach MIME :: Lite me the most talked about. (A link at end of article will also show you why :) But unless you need a piece of working code within five minutes, do not trust me and go see for yourself. If only for the quality of the contributors to the line Mail :: *. For example, the Mail :: Mailer module was originally written by Tim Bunce (author of DBI [2]) and Graham Barr, corrected and documented by Nat Torkington (co-author of the Cookbook - Perl Action) and maintained by Mark overmeer.
The choice of MIME :: Lite was also ordered to me by some tangible criteria (still ;-). MIME :: Lite has exactly the features I need and nothing more (this is an encoder, not a decoder), but no less either (he knows the five types of MIME encoding and fully complies with the specifications ). It is modular enough to allow me to access certain features, while retaining the ability to choose to make use, or not, for some others. In addition, he knows how to take technical decisions better than me who do not master rubber bumper guard all the subtleties of MIME specifications. MIME
The first two to email in general (already mentioned in the previous article, the 2821 and RFC 2822) that meet the other five that give specifications MIME itself. Y are detailed format of an email body (2045), the families of formats (files) provided and what is recommended for each (2046), the in-te
No comments:
Post a Comment