Sending mail with attachment from a shell script

2001-03-23 Thread Cristian Gheorghe

Hello,

I am trying to use mutt in order to be able to send e-mail notifications
in regards to the nightly source code builds that I am doing. Something
to the extent of "Build Failed", see attached file.

I can see how to attach a file, specify the address, subject, etc. It's
just that if I want to do this from the command line without going
inside the interface I can not.

mutt -y [EMAIL PROTECTED] -s "Build Failed" -a ./build.log

To: [EMAIL PROTECTED]

Is there any way I can do this from a script without having to go inside
the actual interface?


Thanks,

Cristian




Re: Sending mail with attachment from a shell script

2001-03-23 Thread Lars Hecking

Cristian Gheorghe writes:
> Hello,
> 
> I am trying to use mutt in order to be able to send e-mail notifications
> in regards to the nightly source code builds that I am doing. Something
> to the extent of "Build Failed", see attached file.
> 
> I can see how to attach a file, specify the address, subject, etc. It's
> just that if I want to do this from the command line without going
> inside the interface I can not.
> 
> mutt -y [EMAIL PROTECTED] -s "Build Failed" -a ./build.log
 
 -y is for interactive use.

 mutt  -s "Build Failed" -a ./build.log [EMAIL PROTECTED] 


Re: Sending mail with attachment from a shell script

2001-03-23 Thread Thomas Roessler

On 2001-03-22 19:12:31 -0500, Cristian Gheorghe wrote:

> I can see how to attach a file, specify the address, subject, etc. It's
> just that if I want to do this from the command line without going
> inside the interface I can not.
> 
> mutt -y [EMAIL PROTECTED] -s "Build Failed" -a ./build.log
> 
> To: [EMAIL PROTECTED]
> 
> Is there any way I can do this from a script without having to go inside
> the actual interface?

Yes.  Just give mutt the message's body on stdin, and don't use -y.
That is, do something like this:

mutt -s "build failed" [EMAIL PROTECTED] < ./build.log
mutt -s "build failed" [EMAIL PROTECTED] -a build.log < body.txt

HTH.
-- 
Thomas Roessler <[EMAIL PROTECTED]>



Re: Sending mail with attachment from a shell script

2001-03-23 Thread teo

Hi Cristian!
On Thu, 22 Mar 2001, Cristian Gheorghe wrote:

> Hello,
> 
> I am trying to use mutt in order to be able to send e-mail notifications
> in regards to the nightly source code builds that I am doing. Something
> to the extent of "Build Failed", see attached file.
> 
> I can see how to attach a file, specify the address, subject, etc. It's
> just that if I want to do this from the command line without going
> inside the interface I can not.
> 
> mutt -y [EMAIL PROTECTED] -s "Build Failed" -a ./build.log
> 
> To: [EMAIL PROTECTED]
> 
> Is there any way I can do this from a script without having to go inside
> the actual interface?
> 
I am using somethin like echo "message body" | mutt -x -a attach.file -s "eh,
subject" [EMAIL PROTECTED]

I dunno if -x is what you want, neither if it's required in the firt place :)
just figured that it works so I use it.

gl

-- teodor



Re: Sending mail with attachment from a shell script

2001-03-23 Thread Cristian Gheorghe

Thank you so much, it actually works.


Regards,

Cristian


Thomas Roessler wrote:

> On 2001-03-22 19:12:31 -0500, Cristian Gheorghe wrote:
>
> > I can see how to attach a file, specify the address, subject, etc. It's
> > just that if I want to do this from the command line without going
> > inside the interface I can not.
> >
> > mutt -y [EMAIL PROTECTED] -s "Build Failed" -a ./build.log
> >
> > To: [EMAIL PROTECTED]
> >
> > Is there any way I can do this from a script without having to go inside
> > the actual interface?
>
> Yes.  Just give mutt the message's body on stdin, and don't use -y.
> That is, do something like this:
>
> mutt -s "build failed" [EMAIL PROTECTED] < ./build.log
> mutt -s "build failed" [EMAIL PROTECTED] -a build.log < body.txt
>
> HTH.
> --
> Thomas Roessler <[EMAIL PROTECTED]>