Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Email Question

by Corion (Patriarch)
on Sep 24, 2015 at 21:14 UTC ( [id://1142951]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Email Question
in thread Email Question

I don't know why the subject wouldn't be set, but there are problems with your snippet as shown:

Single quotes will not interpolate. I suggest you split up the line as:

my $cmd = 'mail -s "Test" testmail@server.com, < DailyReport_$d.txt'; print "Running [$cmd]\n"; system($cmd) == 0 or warn "Couldn't run [$cmd]: $! / $?";

That way, you will see that $d does not interpolate in your command line.

You should swap the quoting style and always quote all the components:

my $cmd = "mail -s 'Test' 'testmail\@server.com' < 'DailyReport_$d.txt +'";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1142951]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found