Mail::Sendmail

C

cartercc

perl doesn't like my return address. Does anyone know why?

error message as follows--------------------
[rudi@tsuse rudi]$ perl mail_test.pl
[rudi@tsuse rudi]$ Bad or missing From address: ''

text of program follows----------------------
[rudi@tsuse rudi]$ vi mail_test.pl
1 #!/usr/bin/perl;
2 use Mail::Sendmail;
3
4 %mail = { To => "ccc31807\@yahoo.com",
5 From => "cartercc\@gmail.com",
6 Subject => 'Test of sendmail',
7 Message => "This is a test of sendmail"};
8
9 $mailtest = sendmail (%mail) or die $Mail::Sendmail::error;
10 print "mailtest is $mailtest\n\n";
11 print "OK, Martha says:\t", $Mail::Sendmail::log;
12
13 exit();

Thanks in advance, CC
 
M

Mark Clements

perl doesn't like my return address. Does anyone know why?

error message as follows--------------------
[rudi@tsuse rudi]$ perl mail_test.pl
[rudi@tsuse rudi]$ Bad or missing From address: ''

text of program follows----------------------
[rudi@tsuse rudi]$ vi mail_test.pl
1 #!/usr/bin/perl;
2 use Mail::Sendmail;
3
4 %mail = { To => "ccc31807\@yahoo.com",
5 From => "cartercc\@gmail.com",
6 Subject => 'Test of sendmail',
7 Message => "This is a test of sendmail"};
8
9 $mailtest = sendmail (%mail) or die $Mail::Sendmail::error;
10 print "mailtest is $mailtest\n\n";
11 print "OK, Martha says:\t", $Mail::Sendmail::log;
12
13 exit();

Thanks in advance, CC
You need

use strict;
use warnings;

This would have pointed out your error to you.

bob 502 $ perl -Mstrict -Mwarnings -le 'my %fg={a=>1}'
Reference found where even-sized list expected at -e line 1.
bob 503 $


Check out the posting guidelines.

Mark
 
G

Gunnar Hjalmarsson

perl doesn't like my return address. Does anyone know why?

error message as follows--------------------
[rudi@tsuse rudi]$ perl mail_test.pl
[rudi@tsuse rudi]$ Bad or missing From address: ''

What makes you believe it's _Perl_ that doesn't like your from address?
Maybe it's the MTA.
 
C

cartercc

use warnings;
This would have pointed out your error to you.

You are so right.
Check out the posting guidelines.

Yeah.

My 55 yo eyes couldn't tell a parens from a curly brace, so I had at
least that excuse. However, I should have realized it when I was typing
it.

Thank you very, very much, and accept my apology for a little bit of
unnecessary trouble.

CC
 
J

John Bokma

My 55 yo eyes couldn't tell a parens from a curly brace, so I had at
least that excuse.

Not really:

use an editor with syntax highlighting, and one that lets you adjust the
fontsize

use strict;
use warnings;
 
M

Mark Clements

You are so right.




Yeah.

My 55 yo eyes couldn't tell a parens from a curly brace, so I had at
least that excuse. However, I should have realized it when I was typing
it.

We've all done it. It's very easily done, as are a lot of other
seemingly trivial typo errors caught by warnings and strict :)

Mark
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top