in reply to Sending info through dialup
I'd suggest that you first find out how to start and stop the dialup connection, which will depend on which distribution of Linux you're using, and what type of dialup account you have. (I used to use a PPP connection back when I used dialup, it was pretty easy to configure and use. Some distros provide a ppp-on and ppp-off script to activate and terminate the link). Then you can write your script, and create a routine to send the EMail, such as:
sub send_message { my ($to, $from, $msg) = @_; # Turn on PPP link, and give it time to connect `ppp-on`; sleep 5; # Create and send message $msg = MIME::Lite->new( From => $from, To => $to, Subject => 'ALERT', ); $msg->attach(Type=>'TEXT', Data=>$msg); $msg->send; # Wait long enough for delivery sleep 5; # Turn off the link `ppp-off`; }
Error checking, correcting bugs and tuneup are your homework. ;^)
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sending info through dialup
by dirtdart (Beadle) on Jan 05, 2011 at 13:38 UTC | |
by unlinker (Monk) on Jan 05, 2011 at 14:01 UTC |