Hi,
Paxton, Darren wrote:
Now for what is probably the bleeding obvious bit. Our standard build
has sendmail disabled by default so what I'd like to do it be able to
tell the mail command to connect to our internal smtp server in order to
deliver the message to the needed recipients.
I've done something very similar in the past to let me know if a mail
server isn't running on reboot - obviously if it's not running I can't
send the email in the normal way ;) I used a Perl script along the lines of:
#!/usr/bin/perl -w
use strict;
use Net::SMTP;
my $smtp = Net::SMTP->new("mailserver.example.com");
$smtp->mail("[EMAIL PROTECTED]");
$smtp->recipient("[EMAIL PROTECTED]",);
$smtp->data;
$smtp->datasend("From: [EMAIL PROTECTED]");
$smtp->datasend("To: [EMAIL PROTECTED]");
$smtp->datasend("Subject: Permissions problem in /tmp\n");
$smtp->datasend("\n");
$smtp->datasend("Please fix permissions on /tmp.");
$smtp->dataend;
$smtp->quit;
Hope this helps.
Michael
_______________________________________________
Scottish mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/scottish