The script completes, but the mail is never sent.
I do not receive any errors..

#! /usr/bin/perl -w

use strict;

my $from = "mailer\@testsite\.com";
my $email = "cmonroe11\@mediaone\.net";
my $subject = "This is a test mail";
my $messagebody = "";
my $mail_program;

#  Initiate the email to the user.

sub send_mail {

    my ($from, $email, $subject, $messagebody) = @_;

    my $flags = "-t";  # -odq would add it to the queue

    $mail_program = '/bin/sendmail';

    $mail_program .= " $flags";

    open (MAIL, "|$mail_program") || die "Could Not Open Mail Program: $!";

    print MAIL <<__END_OF_MAIL__;
To: $email
From: $from
Reply-to: $from
Subject: $subject
Content-Type: text/plain;

$messagebody

__END_OF_MAIL__

    close (MAIL);

} # End of send_mail


print "Content-type: text/html\n\n";

print <<"EOF";

<html>

<body>

Sent email:
$from
$email
$subject
$messagebody

</body>

</html>

EOF

----------------------------------------------------------------------------
-----
Sorry remedial question, but whew this one is getting to me...

Craig
[EMAIL PROTECTED]
http://www.msbwebdesign.com
Pager
Numeric: 1-877-895-3558
Email pager: [EMAIL PROTECTED]
--------------------------------------------------------------
You will never find time for anything.
If you want time, you must make it.

Charles Buxton


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to