Don't queue the responses, rather use the options available in the mail command. I use mutt, but mail has the similar options. In the following mutt example $email contains the email address(es) and $subject contains the subject, and mutt.include is the body of the email text. There is also a -a flag for attachments.
From: Linux on 390 Port [mailto:LINUX-390@VM.M...] On Behalf Of Scully, William P
Sent: Thursday, April 19, 2012 2:11 PM
To: LINUX-390@VM.M... Subject: EXTERNAL: Rexx/Regina on Linux
I'd like a Rexx exec on Linux to send an email. My first attempt at this is:
Queue 'This Is My Subject'
Queue 'This is the body of the email text.'
Queue '.' /* exit mail's input mode */
The pre-queued responses for the mail command don't help and mail ends up prompting me interactively.
Does anyone know how I might queue replies to the Linux mail command?