|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
At 2008-03-25 07:17PM, "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) ( printf "Subject: %s\nCc: %s\nBcc: %s\n\n" "$sub" "$cc" "$bcc" cat "$filename" ) | /usr/lib/sendmail -t -oi -- Glenn Jackman "You can only be young once. But you can always be immature." -- Dave Barry |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
someusernamehere <someusernamehere@gmail.com> 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) You can do this with mutt. Mutt doesn't have to be used in interactive mode. mutt -b user@blind.com -c user@copy.com -s "subject" user@foo.bar < /home/user/foo.txt -- Gary Johnson |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 25 mar, 17:28, Glenn Jackman <gle...@ncf.ca> wrote:
> At 2008-03-25 07:17PM, "someusernamehere" wrote: > > > There is a way for send mails only with shell commands?, I mean I know > > how to send with mutt -c u...@copy.com -s "subject" u...@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) > > ( printf "Subject: %s\nCc: %s\nBcc: %s\n\n" "$sub" "$cc" "$bcc" > cat "$filename" > ) | /usr/lib/sendmail -t -oi oh, thanks it works, but the original recipent is missing how to put them into? P.S. I dont want to use mutt ;-) many thanks |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>> ( printf "Subject: %s\nCc: %s\nBcc: %s\n\n" "$sub" "$cc" "$bcc"
>> cat "$filename" >> ) | /usr/lib/sendmail -t -oi > > > oh, thanks it works, but the original recipent is missing how to put > them into? may be adding a $to variable and printing it's value. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|