Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How to send email

by httptech (Chaplain)
on Jul 06, 2000 at 01:07 UTC ( [id://21231]=note: print w/replies, xml ) Need Help??


in reply to How to send email

It looks like you are missing the leading quotation mark in your system call. Running perl -wc on your code will help you find small errors like this.

Update: I ran perl -wc on this code and it didn't spit out any errors, so it wouldn't have helped you in this case. It's still a good idea to use it though :)

I would try and shy away from writing the mail to a temp file though; it will be a headache for you if the directory or file permissions ever get changed. I would probably do something like:

open (MAIL, "|/usr/sbin/sendmail -t -oi -em") || die "Couldn't open sendmail: $!"; print MAIL <<EOM; To: me\@mycompany.com From: myscript\@mycompany.com Subject: Some subject $reportdata EOM close (MAIL);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found