473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

sending mail through python

rhitam30111985
112 100+
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
1 1445
rhitam30111985
112 100+
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

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

Similar topics

3
by: Gerhard Häring | last post by:
On my mailserver (running a recent Postfix snapshot) I get this since a few hours: mylene:/var# mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- DA10713E37 1617 Wed...
3
by: Andrew McLean | last post by:
I am writing a CGI script on an account that only has Python 1.5.2. It's principal purpose is to take some user input from a form, do some manipulation and return some information to the user....
5
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Suppose you want to spam your friend, and you have lots of # friends. The solution is to write a program to do it. After a gander # at python docs, one easily...
0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
9
by: Leo Breebaart | last post by:
I am writing a utility in Python and I'd like to add a command-line option "--mailto <address>" that will cause an e-mail summary to be sent to <address> when the utility finishes running. My...
4
by: praba kar | last post by:
Dear All, Normally we can send mail using telnet in linux. In the following way telnet Ipaddress 25 mail from: raj@rajkumar.com 250 o.k(response of from commandline) rcpt to: test@oops.co.in...
6
by: Gary Kshepitzki | last post by:
Hello I am trying to send an event from a Python COM server to a VB (or VB.NET) COM client. I am a newbie both in VB and in python. Can anyone give me a simple (but complete) code example both of...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
4
by: peter.jones.rpi | last post by:
I work at a training center and I would like to use Python to generate a number of certificates and then e-mail them. The certificates are a problem for another day - right now I just want to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.