Subversion Repositories DevTools

Rev

Rev 6887 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6887 dpurdie 1
########################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
3
#
4
# Module name   : jats_play_sendmail.pl
5
# Module type   : JATS Utility
6
# Compiler(s)   : Perl
7
# Environment(s): jats
8
#
9
# Description   : 
10
#
11
# Usage         : See POD at the end of this file
12
#
13
#......................................................................#
14
 
15
require 5.008_002;
16
use strict;
17
use warnings;
18
 
19
use Pod::Usage;
20
use Getopt::Long;
21
use LWP::UserAgent;
22
use HTTP::Request::Common 'POST';
23
 
24
use JatsError;
25
my $now = localtime;
26
 
27
#
28
#   Trap: This actually uses SEND mail to do the hard work
29
#         It won't work under windows, unless there is a send mail program available
30
#         Does explain how it determines the server under Unix
31
#
32
 
33
 
34
my $req = POST( 'mailto:dpurdie@vixtechnology.com',
35
    From         => 'buildadm@vixtechnology.com',
36
    #CC           => 'david@dpurdie.dyndns.org',
37
    To           => 'David.Purdie',
38
    Sender       => 'My.Test.Program',
39
    Date         => scalar localtime,
40
    Subject      => 'Test Message - ' . $now,
41
    Content_Type => qq(text/html),
42
    Content      => 'This is the body of the test message',
43
);
44
 
45
my $response = LWP::UserAgent->new->request($req);
46
if ($response->code != 202)
47
{
48
    print("BAD Send\n");
49
    #DebugDumpData("Response", \$response);
50
}
51
else
52
{
53
    print("Sent OK\n");
54
}
55