FUNCTIONS

new

        TRD::WebRelayMailオブジェクトを作成するコンストラクタです。
        my $relaymail = new TRD::WebRelayMail;

setSendUrl( $url )

        リレー先URLを設定します。
        $relaymail->setSendUrl( 'http://foobar/relay/rmail.cgi' );
        リレー先のcgiには、TRD::WebRelayMail->Recv()を使用します。

setProxy( $proxy )

        リレー先URLへ接続する際のProxyを設定します。
        $relaymail->setProxy( 'http://proxy.foobar:8080/' );
        TRD::WebRelayMain->Send()を使用する際にProxyを使用します。

Send( $message )

        リレーメールを送信します。
        my $res = $relaymail->Send( $mime->stringify );

        $messageは、MIME::Entityで作成された物を使用します。
        返り値は、=1 送信完了。!=1 エラー。

Recv( $cgi )

        リレーメールを受信します。
        $cgiはCGIを設定します。
        TRD::WebRelayMail->setSendUrlで設定した受信cgiで使用します。

url_encode( $str )

        文字列をURLエンコードします。
        $str = $relaymail->url_encode( $str );

NAME

TRD::WebRelayMail - メールを送れないホストからのWebメールリレーモジュール

VERSION

This document describes TRD::WebRelayMail version 0.0.4

SYNOPSIS

        # 送信用
        use strict;
        use Jcode;
        use MIME::Entity;
        use TRD::WebRelayMail;

        my $relaymail = new TRD::WebRelayMail;
        $relaymail->setSendUrl( 'http://foobar/relay/rmail.cgi' );
        my $mail_to = 'receiver@barbas.com';
        my $mail_from = 'sender@barbas.com';
        my $mail_subject = 'TEST MAIL';
        my $mail_body = 'THIS IS TEST';

        $mail_subject = jcode( $mail_subject )->mime_encode;
        Jcode::convert( \$mail_body, 'jis' );

        my $mime = MIME::Entity->build(
                From => $mail_from,
                To => $mail_to,
                Subject => $mail_subject,
                Type => 'text/plain; charset="iso-2022-jp"',
                Data => $mail_body,
        );

        my $res = $relaymail->Send( $mime->stringify );
        if( !$res ){
                print "NG\n";
        } else {
                print "OK\n";
        }

        #[EOT]

        # 受信用
        use strict;
        use CGI;
        use TRD::WebRelayMail;

        my $cgi = new CGI;
        my $relaymail = new TRD::WebRelayMail();

        my $data = $relaymail->Recv( $cgi );

        if( !$data->{'res'} ){
                print "Content-type: text/html\n\n";
                print "ng";
        } else {
                print "Content-type: text/html\n\n";
                print "ok";

                open( my $m, "| /usr/sbin/sendmail -t" );
                print $m $data->{'message'};
                close( $m );
        }

        # [EOT]

DESCRIPTION

INTERFACE

DIAGNOSTICS

Error message here, perhaps with %s placeholders

[Description of error here]

Another error message here

[Description of error here]

[Et cetera, et cetera]

CONFIGURATION AND ENVIRONMENT

TRD::WebRelayMail requires no configuration files or environment variables.

DEPENDENCIES

None.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-trd-webrelaymail@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Takuya Ichikawa <ichi@cpan.org>

LICENCE AND COPYRIGHT

Copyright (c) 2009, Takuya Ichikawa <ichi@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 20:

Non-ASCII character seen before =encoding in 'TRD::WebRelayMailオブジェクトを作成するコンストラクタです。'. Assuming UTF-8