uttsu.com >

sendmail.pl

#!/usr/local/bin/perl

# sendmail.pl - sendmailのテスト
# (C) Takashi Utsunomiya
# http://uttsu.com/
# 2002.11.19

# description:
# ブラウザからこのCGIにアクセスすると$to宛てにメールを送ります。

use strict;

my $sendmail_path = "/usr/lib/sendmail";
my $from = 'test@uttsu.com';
my $to = 'test@uttsu.com';

main();
exit;

sub main {
    open(SENDMAIL, "|$sendmail_path -t");
    print SENDMAIL <<END;
From: $from
To: $to
Subject: test

This is test.
END

    print "Content-type: text/html\n\n";
    print "メールを送信しました。";
}


Copyright (C) Takashi Utsunomiya. All Rights Reserved.
2002.11.20掲載