Send Email with a System Call
Previous Topic  Next Topic 

Purpose

 

This example Perl program shows how NetMailBot can be invoked from within Perl using a "system" call.

 

Additional Prerequisites

 

Using this feature requires knowledge of the Perl programming language and a working installation of Perl on your computer.

 

Prepared Example Files

 

 

The archive contains one file:

 

 

Perl File Contents

 

This is the content of the Perl file:

 

#!/usr/bin/perl -w

use strict;

 

my $executable = 'NetMailBot.exe';

my $server = 'mail.domain.com';

my $from = 'to@domain.com';

my $to = 'from@domain.com';

my $subject = 'Test: Perl system call';

my $body = "Test: Perl system call";

 

my @args = (  "$executable", "-d", "-S", "$server", 

                     "-from", "$from", 

                     "-to", "$to", 

                     "-server", "\"$subject\"", 

                     "-body", "\"$body\""

                  );

my $result = system(@args);

print "$result";