Send email: Difference between revisions

→‎{{header|TXR}}: Modernize: no @(next "-") for standard input, or "!mail" for piping. Some mail programs don't have -c option for CC.
(factor email example actually works now)
(→‎{{header|TXR}}: Modernize: no @(next "-") for standard input, or "!mail" for piping. Some mail programs don't have -c option for CC.)
Line 1,262:
=={{header|TXR}}==
<lang txr>#!/usr/bin/txr
#!/usr/bin/txr
@(next :args)
@(cases)
Line 1,274 ⟶ 1,275:
@ (throw error "must specify at least To and Subject")
@(end)
@(next "-"*stdin*)
@(collect)
@BODY
@(end)
@(output (open-command `!mail -s "@SUBJ" -ca CC: "@CC" "@TO"` "w"))
@(repeat)
@BODY
@(end)
.
@(end)</lang>
</lang>
 
{{out}}
Test run:
 
<pre>$ ./sendmail.txr linux-kernel@vger.kernel.org "Patch to rewrite scheduler #378"
Line 1,303:
{{omit from|zkl}}
{{omit from|ZX Spectrum Basic|Does not have network access.}}
 
 
=={{header|VBScript}}==
543

edits