[ydl-gen] Sending mail from the command line

Geert Janssens janssens-geert at telenet.be
Thu Sep 7 08:23:48 MDT 2006


I like Joseph's suggestion. But if that is not an option for you, you could 
use postfix's sendmail instead of mail for your purpose.

echo "<mail contents including To:,From:,Date: and Subject: headers>" |
     /usr/sbin/sendmail -f <from address> <to address>

Note that although sendmail is stored in /usr/sbin, it can be used as an 
ordinary user as well for this purpose.

Geert

On Thursday 07 September 2006 15:53, Joseph E. Sacco, Ph.D. wrote:
> Why not route root's main to yourself:
>
> As root:
>
> (1) open /etc/aliases in your favorite editor
>
> (2) add/edit the following lines at the bottom of the file
>
>         # Person who should get root's mail
>         root:           your-user-name
>
> (3) run the command
>
>    newaliases
>
> (4) test
> send root some email
>
> -Joseph
>
> ============================================================
>
> On Thu, 2006-09-07 at 09:35 -0400, Eric Dunbar wrote:
> > Hello all, I've been trying to figure out how to send an e-mail using
> > a tcsh script. I've created a script to monitor my server's IP and
> > update the DNS server when it changes (I'm on dynamic IP).
> >
> > I want to send myself an e-mail whenever it has to update the DNS
> > server (at present it sends root an e-mail but I don't check my root
> > e-mail that frequently).
> >
> > I've been trying to use mail to send an e-mail but cannot automate the
> > process:
> >
> > mail -s My\ subject my.email at nowhere.com
> >
> > At first I tried piping a file into the command but haven't got that
> > to work (composing the e-mail requires one to press ^D to terminate
> > the e-mail followed by an enter to accept no cc:).
> >
> > Any ideas? Is there another mechanism I should be using to email stuff
> > automagically? Is there an interface to send mail I should be using?
> >
> > Thanks, Eric.
> > _______________________________________________
> > yellowdog-general mailing list
> > yellowdog-general at lists.terrasoftsolutions.com
> > http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
> > HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'


More information about the yellowdog-general mailing list