On Tue, Aug 21, 2001 at 06:12:25PM -0400, Craig S Monroe wrote:
> The script completes, but the mail is never sent.
> I do not receive any errors..
Have you checked your mail logs?
> #! /usr/bin/perl -w
>
> use strict;
>
> my $from = "mailer\@testsite\.com";
> my $email = "cmonroe11\@mediaone\.net";
No need to escape the . - it's not special. This is probably your
problem. If you use single quotes there's no need to escape anything.
> 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);
It would be a good idea to check that the close worked here.
> } # End of send_mail
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]