sending mail through python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rhitam30111985
    New Member
    • Aug 2007
    • 112

    sending mail through python

    Hi all .. i am trying to do something really weird ...
    here is my code :

    [CODE=python]

    import os
    os.system("mail -s test xxx@gmail.com asdaskdjkasdaas dad")

    [/CODE]

    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
  • rhitam30111985
    New Member
    • Aug 2007
    • 112

    #2
    never mind . figured it out .. :

    [CODE=python]
    import os
    os.system("mail -s test xxx@gmail.com <<< ahahahahaaaaaa" )
    [/CODE]

    Comment

    Working...