Send Email with a System Call
Previous Topic  Next Topic 



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 = '';

my $from = '';

my $to = '';

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";