Shell code:
msg="body of the mail"
echo "$msg" | mailx -s "ERROR" udhai
Python Code:
msg="body of the mail"
subprocess.call(msg + " | mailx -s 'ERROR:' udhai",shell=True)
When I execute my shell script, I am receiving email to the udhai account with both the message (body of the mail) and the subject("ERROR:").
But in my python code, I am receiving email only with the subject.
How can I receive the email with the subject and message.