Afficher un message
Vieux 26/03/2008, 04h29   #6
Wayne
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: send a mail with copies only with shell

someusernamehere wrote:
> There is a way for send mails only with shell commands?, I mean I know
> how to send with mutt -c user@copy.com -s "subject" user@foo.bar
> its possibly only with sendmail or whatever send a mail with:
>
> * a desired subject (foobar for example)
> * a Carbon copy (Cc) destinator
> * a shadow copy (Bc) destinator
> * reading the content of a file for the body (e.g. /home/user/foo.txt)
>
>
> thanks a lot


mutt can be run in non-interactive mode. I usually use
mailx for this. But you can use sendmail directly as well.

With sendmail you list all recipients on the command line.
Then add whatever headers you wish (Subject:, Cc:, Date:, etc.)
followed by a blank line, and then the body of your email.

Note there is never a Bcc header; to implement BCC you just
list extra recipients on the command line. Also note
sendmail will automatically create the required "From "
and "Date:" headers. You can over-ride the "From "
header with -f<name> if you are a "trusted" user.

All other headers are optional but you probably would
want to add "To:", "Cc:", and "Subject:" headers.

sendmail user1@example.com user2 user3 user4 <<!
To: user1
Cc: user2 user 3
Subject: yada yada yada

$(cat file-with-body-of-email-content)
!

See RFC 4021 for some commonly used headers.

-Wayne
  Réponse avec citation
 
Page generated in 0,05744 seconds with 9 queries