Usage of sendmail utility in AIX using Runtime.exec()
Hi,
I am trying to send a mail using mail/mailx utility through java Runtime.exec..I couldn't send a message located in a separate file
my code:
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("mailx -s "email-subject" id@dot.com <temp.txt );
contents of temp.txt :
Auto-generated mail
result:
mail has been sent to id@dot.com
message looks like
From:me@dot.com
To:><temp.txt@dot.com; id@dot.com
subject:email-subject
Body-Content: ><empty>
Expected result:
From:me@dot.com
To:id@dot.com
subject: email-subject
Body-Content: Auto-generated mail
when i try the same command in shell i get the correct result.
please help me to solve this.
Thanks in advance,
Subbu

