zentara wrote:

<snip>

So now all you have to do is setup the mailings.
For example, this code should work, but there are many mail modules
available to make it easier.

my $mailprog='/usr/sbin/sendmail';
my $email = $emailaddr;
my $from = '[EMAIL PROTECTED]';

open( MAIL, "|$mailprog -t" )
         || safe_die("Can't start mail program $mailprog $!");
print MAIL "To: $email\n";
print MAIL "From: $from\n";
print MAIL "Subject: Upload Notification\n";
print MAIL "\n\n";  #important to print this
print MAIL "Thank you for your upload .\n\n";
print MAIL "$file_upload  -> $fsize\n";
print MAIL "-" x 75 . "\n";
close(MAIL);

And you can do it again to mail it to yourself with the $comment.

So there it's basically all done for you.


I agree with everything he's said, but please don't do mail this way, use a module from CPAN. There are plenty of good ones out there that range from incredibly simple to very complex. I suspect zentara didn't want to go down this route as it involves CPAN, installing modules, learning documentation, and many more questions. In the long run you are better off learning these things, in the end do what you will...But don't necessarily expect help on why your sendmail code is broken or you don't receive messages, etc.


http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to