Linux-admin Development Archive on lore.kernel.org
 help / color / mirror / Atom feed
* sending mail from a bash script
@ 2002-05-14 11:55 Dirk Bonenkamp - Bean IT
  2002-05-14 15:12 ` Glynn Clements
  0 siblings, 1 reply; 4+ messages in thread
From: Dirk Bonenkamp - Bean IT @ 2002-05-14 11:55 UTC (permalink / raw)
  To: linux-admin

Hi all,

I think this one is quite simple, but couldn't find the answer on the net 
(not in a matter of minutes, that is :-))....

I want to send a mail from a bash script... How do I do this??

TIA,

Dirk



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: sending mail from a bash script
@ 2002-05-14 12:03 johnjulian1
  2002-05-14 12:49 ` David Lubowa
  0 siblings, 1 reply; 4+ messages in thread
From: johnjulian1 @ 2002-05-14 12:03 UTC (permalink / raw)
  To: Dirk Bonenkamp - Bean IT, linux-admin

mail Somebody@somewhere.org < MailMessageFile
or
echo "message to send
including new lines" | mail somebody@somewhere.org

Dirk Bonenkamp - Bean IT <dirk@bean-it.nl> wrote:

>Hi all,
>
>I think this one is quite simple, but couldn't find the answer on the net 
>(not in a matter of minutes, that is :-))....
>
>I want to send a mail from a bash script... How do I do this??
>
>TIA,
>
>Dirk
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: sending mail from a bash script
  2002-05-14 12:03 sending mail from a bash script johnjulian1
@ 2002-05-14 12:49 ` David Lubowa
  0 siblings, 0 replies; 4+ messages in thread
From: David Lubowa @ 2002-05-14 12:49 UTC (permalink / raw)
  To: johnjulian1, Dirk Bonenkamp - Bean IT, linux-admin


i have a bash script that sends a user mail when created  on the mailserver
i am running Postfix so i can only create a MailDir when i send a user
e-mail when created , have a look through it and see if it i will help you.

[snip]

#!/bin/bash

useradd -mk /dev/shm -d /var/home/$1 -s /bin/false $1;
cd /var/home
chown -R $1.users $1/

echo "blah blah blah  problems e-mail  support@foo.com" | mutt  -s Greetings
$1

[/snip]

hope this helps ..thats how i am sendig an e-mail from a bash script. works
well for me :)

ziggy

-----Original Message-----
From: linux-admin-owner@vger.kernel.org
[mailto:linux-admin-owner@vger.kernel.org]On Behalf Of
johnjulian1@netscape.net
Sent: Tuesday, May 14, 2002 3:03 PM
To: Dirk Bonenkamp - Bean IT; linux-admin@vger.kernel.org
Subject: RE: sending mail from a bash script


mail Somebody@somewhere.org < MailMessageFile
or
echo "message to send
including new lines" | mail somebody@somewhere.org

Dirk Bonenkamp - Bean IT <dirk@bean-it.nl> wrote:

>Hi all,
>
>I think this one is quite simple, but couldn't find the answer on the net
>(not in a matter of minutes, that is :-))....
>
>I want to send a mail from a bash script... How do I do this??
>
>TIA,
>
>Dirk
>
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas.
Experience the convenience of buying online with Shop@Netscape!
http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sending mail from a bash script
  2002-05-14 11:55 Dirk Bonenkamp - Bean IT
@ 2002-05-14 15:12 ` Glynn Clements
  0 siblings, 0 replies; 4+ messages in thread
From: Glynn Clements @ 2002-05-14 15:12 UTC (permalink / raw)
  To: Dirk Bonenkamp - Bean IT; +Cc: linux-admin


Dirk Bonenkamp - Bean IT wrote:

> I think this one is quite simple, but couldn't find the answer on the net 
> (not in a matter of minutes, that is :-))....
> 
> I want to send a mail from a bash script... How do I do this??

	sendmail recipient@foo.com < msg.txt

or similar. The input should be a complete message, including headers.

Using mailx (aka "mail") is best avoided. It may just feed the message
directly to sendmail (so there's no advantage to using mailx), or it
may attempt to process "tilde" sequences, which is usually the wrong
thing to do.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-14 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-14 12:03 sending mail from a bash script johnjulian1
2002-05-14 12:49 ` David Lubowa
  -- strict thread matches above, loose matches on Subject: below --
2002-05-14 11:55 Dirk Bonenkamp - Bean IT
2002-05-14 15:12 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox