[PERL] HTML 메일 발송 테스트

ITWeb/개발일반 2009. 7. 27. 15:01

아래 글에 이어서.. 추가 입니다.

참고 URL :
http://alma.ch/perl/Mail-Sendmail-FAQ.html
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/Sendmail.pm

sub setSendMail {
    my $message = $_[0];

    %mail = (
                To           => 'to@email.com',
                From         => 'from@email.com',
                Subject      => 'TITLE',
                'Content-type'  => 'text/html; charset="UTF-8"',
                Message      => "<span style='font-size:11px; font-family:맑은 고딕, 돋움'>$message</span>"
            );

    if ( $message ) {
        sendmail(%mail) or die $Mail::Sendmail::error;
        print "OK. Log says:\n", $Mail::Sendmail::log;
    }
}

보시는 바와 같이 빨간 부분을 추가해 주시면 됩니다.
Content-type 앞뒤로 quotation 빼먹으시면 정상적으로 적용 안되니 유의 하세요.

: