Lingua::JA::Mail - compose mail with Japanese charset
use utf8; use Lingua::JA::Mail; $mail = Lingua::JA::Mail->new; $mail->add_from('email@example.com', 'YAMADA, Taro'); # display-name is omitted: $mail->add_to('firstname.lastname@example.org'); # with a display-name in US-ASCII characters: $mail->add_to('email@example.com', 'Sakura HARUNO'); # with a display-name containing Japanese characters: $mail->add_to('firstname.lastname@example.org', '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.
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.
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:
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.
Masanori HATA <email@example.com> (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.