By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,986 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,986 IT Pros & Developers. It's quick & easy.

sending mail through python

rhitam30111985
100+
P: 112
Hi all .. i am trying to do something really weird ...
here is my code :

Expand|Select|Wrap|Line Numbers
  1.  
  2. import os 
  3. os.system("mail -s test xxx@gmail.com asdaskdjkasdaasdad")
  4.  
  5.  
the problem is ... while sending email through shell .. u have to press CTRL +D after the message body is complete ... i have tried sending mail directly from my shell and it works perfectly fine ... . but i have been assigned to do the same thing in python .. how do i do the same action ie CTRL D in python ... . any help hugely appreciated .. i am using debian linux btw



regards
rhitam
Apr 9 '08 #1
Share this Question
Share on Google+
1 Reply


rhitam30111985
100+
P: 112
never mind . figured it out .. :

Expand|Select|Wrap|Line Numbers
  1. import os 
  2. os.system("mail -s test xxx@gmail.com <<< ahahahahaaaaaa")
  3.  
Apr 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.