sendmail issue

L

lerameur

HI again,

I wrote this small script to test my send mail. The script is placed
in the root directory and has the executable permission. It runs
without error, but I never received the email:

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" );
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL );


k
 
E

Eric Schwartz

lerameur said:
I wrote this small script to test my send mail. The script is placed
in the root directory and has the executable permission. It runs
without error, but I never received the email:

If that's the case, then your problem isn't in your perl script; it's
in your mail server. I recommend finding a newsgroup related to your
mail server, and asking about it there.

-=Eric
 
J

John W. Krahn

lerameur said:
I wrote this small script to test my send mail. The script is placed
in the root directory and has the executable permission. It runs
without error,

Because you ignore any errors that may be generated.
but I never received the email:

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" );
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL );

open my $MAIL, '|-', '/usr/lib/sendmail', '-t'
or die "Cannot open pipe to sendmail: $!";

print $MAIL <<'MAIL' or warn "Cannot print to sendmail: $!";
From: email address
To: (e-mail address removed)
Subject: Something here

MAIL

close $MAIL
or warn $! ? "Error closing sendmail pipe: $!"
: "Exit status $? from sendmail";



John
 
L

lerameur

I wrote this with the die command

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" ) or die ("Cannot open pipe to
sendmail: $!");
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL ) or die ("Cannot close sendmail: $!");

no errors, no mail receives


k
 
T

Tony Curtis

lerameur said:
I wrote this with the die command

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" ) or die ("Cannot open pipe to
sendmail: $!");
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL ) or die ("Cannot close sendmail: $!");

no errors, no mail receives

then, as someone previously pointed out, the problem must be somewhere
outside of perl, e.g. your local sendmail setup.

hth
t
 
S

smallpond

HI again,

I wrote this small script to test my send mail. The script is placed
in the root directory and has the executable permission. It runs
without error, but I never received the email:

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" );
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL );

k


Because you never gave it the end of the email, which
is defined as a "." on a line by itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top