dirtdart:

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.


In reply to Re: Sending info through dialup by roboticus
in thread Sending info through dialup by dirtdart

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.