How to copy mail content in a file in Unix

Hi Guys
I want to write a script which search mail with subject line and after that I want the mail content in a file
please help guys.

Thanks
Atul Singh

Can you display a sample of the data?

The correct way to post here is:
You should start first by writing your script then once stuck or facing issues, submit your code for us to help you get it to work, stop expecting others to do your work....

Hi
I want to use mail subcommands in one line..
example :

$ mail
Mail version 8.1 6/6/93.  Type ? for help.
"/var/spool/mail/training": 19 messages 19 unread
>U  1 MAILER-DAEMON@localh  Wed Jul 20 17:28 116/3450  "Returned mail: This is the mail"
 U  2 MAILER-DAEMON@localh  Thu Jul 21 10:19  65/2545  "Returned mail: details"
 U  3 MAILER-DAEMON@localh  Mon Aug 29 15:44  68/2742  "Returned mail: see "
 U  4 MAILER-DAEMON@localh  Tue Aug 30 15:13  68/2762  "Returned mail: transcript"

I want to open mail which have this subject line "Returned mail: transcript" and want to copy the mail content in a file.
I tried with the mail commands but not able to..
please help