1use Apache::ASP::CGI;
2
3&Apache::ASP::CGI::do_self(NoState => 1,
4			   Debug => 3,
5			   # defaults to localhost for mail relay
6			   # but will lookup in Net::Config too for
7			   # other hosts
8			   MailHost => '127.0.0.1',
9			   );
10
11__END__
12
13<% use lib '.';	use T;	$t =T->new(); %>
14<%
15
16# test for Net::SMTP, and skip if not installed
17eval "use Net::SMTP";
18if($@) {
19    return;
20} else {
21    my $smtp = Net::SMTP->new('127.0.0.1');
22    unless($smtp) {
23	return;
24    }
25}
26
27$t->eok($Server->Mail({
28			# won't actually send the mail in test mode
29			Test => 1,
30			# make the address fairly legit, in case the SMTP
31			# is validating in realtime
32			To => "asptest\@chamas.com",
33			# no from, since some mail gateways may not relay * addresses
34			# so we allow for From not to be set while Test is set
35			# From => "INSTALL_TEST\@apache-asp.org",
36			Subject => "Test Email",
37			Body => "Test Body",
38			Debug => 0
39			}),
40	"\$Server->Mail() failed in test mode, check that your mail server at 127.0.0.1 can relay email. "
41	);
42%>
43<% $t->done; %>
44