Lingua::JA::Mail - compose mail with Japanese charset
use utf8; use Lingua::JA::Mail; $mail = Lingua::JA::Mail->new; $mail->add_from('taro@cpan.tld', 'YAMADA, Taro'); # display-name is omitted: $mail->add_to('kaori@cpan.tld'); # with a display-name in US-ASCII characters: $mail->add_to('sakura@cpan.tld', 'Sakura HARUNO'); # with a display-name containing Japanese characters: $mail->add_to('yuri@cpan.tld', 'NAME CONTAINING JAPANESE CHARS'); # mail subject containing Japanese characters: $mail->subject('Subject', 'SUBJECT CONTAINING JAPANESE CHARS'); # mail body containing Japanese characters: $mail->body('BODY CONTAINING JAPANESE CHARS'); # compose and output print $mail->compose;
This module is produced mainly for Japanese Perl programmers those who wants to compose an email with Perl extention.
For some reasons, most Japanese internet users have chosen ISO-2022-JP 7bit character encoding for email rather than the other 8bit encodings (eg. EUC-JP, Shift_JIS).
We can use ISO-2022-JP encoded Japanese text as message body safely in an email.
But we should not use ISO-2022-JP encoded Japanese text as a header. We should escape some reserved special characters before composing a header. To enable it, we encode ISO-2022-JP encoded Japanese text with MIME Base64 encoding. Thus MIME Base64 encoded ISO-2022-JP encoded Japanese text is safely using in a mail header.
special
This module has developed to intend to automate those kinds of operations.
This method is the constructor class method.
See Lingua::JA::Mail::Header for the descriptions.
This method specifies the body of the message. It can contain Japanese characters.
Note: RFC1468 describes about a line should be tried to keep length within 80 display columns. Then each JIS X 0208 character takes two columns, and the escape sequences do not take any. This module itself does not provide any auto-folding functions. See Lingua::JA::Fold about the folding of Japanese text.
This method gathers and builds the header fields, then convine with the body of the message and then returns the overall message.
This method composes the overall message (see compose) and pipes the data to the sendmail program. Posts a mail using sendmail program.
compose
At the default, it is supposed that the sendmail command is `sendmail' under a location of systems's PATH environmental variable. You can specify exact location. Ex:
$mail->sendmail('/usr/bin/sendmail');
This module runs under Unicode/UTF-8 environment (hence Perl5.8 or later is required), you should input octets with UTF-8 charset. Please use utf8; pragma to enable to detect strings as UTF-8 in your source code.
use utf8;
Masanori HATA <lovewing@dream.big.or.jp> (Saitama, JAPAN)
Copyright (c) 2003-2005 Masanori HATA. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Lingua::JA::Mail, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::JA::Mail
CPAN shell
perl -MCPAN -e shell install Lingua::JA::Mail
For more information on module installation, please visit the detailed CPAN module installation guide.