so far this is what I have
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl -w
- use strict;
- my $executable = "saplotus.exe';
- my $server = 'test@domain';
- my $from = 'aetinti@gmail.com';
- my $to = 'aetinti@gmail.com';
- my $subject = 'Test: Perl system call';
- my $body = "Test: Perl system call";
- my @args = ( "$executable", "-server", "$server",
- "-from", "$from",
- "-to", "$to",
- "-subject", "\"$subject\"",
- "-body", "\"$body\""
- );
- my $result = system(@args);
- print "$result";
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- use CGI;
- my $query = new CGI;
- my $sendmail = "/usr/sbin/sendmail -t";
- my $reply_to = "Reply-to: aetinti@gmail.com";
- my $subject = "Subject: Confirmation of your submission";
- my $content = "Thanks for your submission.";
- my $to = $query -> param('send_to');
- my $file = "subscribers.txt";
- unless ($to) {
- print $query->header;
- print "Please fill in your email and try again";
- }
- open (FILE, ">>$file") or die "Cannot open $file: $!";
- print $to,"\n";
- close(FILE);
- my $send_to = "To: ". $query->param('send_to');
- open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
- print SENDMAIL $reply_to;
- print SENDMAIL $subject;
- print SENDMAIL $to;
- print SENDMAIL "Content-type: text/plain\n\n";
- print SENDMAIL $content;
- close(SENDMAIL);
- print $query->header;
- print "Confirmation of your submission will be emailed to you.";