#!/usr/bin/python
import os
import smtplib
content = str(os.system('df -h /'))
print (content)
mail=smtplib.SMTP('smtp.gmail.com:587')
mail.ehlo()
mail.starttls()
mail.login('*****@gmail.com','****')
mail.sendmail('*******@gmail.com','**********@gmail.com',content)
mail.close()
My issue is that when I got the mail it displayed only 0.
It is not printing the output of df -h /
.
Can anyone help me out in this.
I think it is storing the output in var and not in string ...