Go Back   Tutorial Ninjas > Niche Talk > Tech Talk
Tech Talk Talk about the latest tech stuff here!
Reply
 
LinkBack (1) Thread Tools Display Modes
Old 04-09-2007, 09:53 PM   #11 (permalink)
Ipp
Administrator
 
Ipp's Avatar
 
Join Date: Feb 2007
Location: Maryland
Posts: 1,983
Send a message via AIM to Ipp Send a message via MSN to Ipp Send a message via Skype™ to Ipp
Default

I'll start you off, its up to you to finish it:

Code:
import sys, smtplib
    
#get info
from = raw_input("From: ")
to  = string.splitfields(raw_input("To: "), ',')
print "Enter message, end with ^D:"
msg = ''
while 1:
    line = sys.stdin.readline()
    if not line:
        break
    msg = msg + line
#send
server = smtplib.SMTP('localhost')
server.sendmail(from, to, msg)
server.quit()
Ipp is offline   Reply With Quote
Old 04-09-2007, 10:42 PM   #12 (permalink)
Venom
Ninja Tutorialist
 
Join Date: Mar 2007
Posts: 195
Default

venom@venom-desktop:~$ sudo python email.py
Password:
File "email.py", line 1
import sys, smtplib
^
SyntaxError: invalid syntax
venom@venom-desktop:~$


hmmmmmmmm
Venom is offline   Reply With Quote
Old 04-09-2007, 10:47 PM   #13 (permalink)
Ipp
Administrator
 
Ipp's Avatar
 
Join Date: Feb 2007
Location: Maryland
Posts: 1,983
Send a message via AIM to Ipp Send a message via MSN to Ipp Send a message via Skype™ to Ipp
Default

Guess i shoulda tested it first, i'll play with one tmw.

where the extra spaces in therE? i just edited it. Python pays attention to that.
Ipp is offline   Reply With Quote
Old 04-09-2007, 10:57 PM   #14 (permalink)
Venom
Ninja Tutorialist
 
Join Date: Mar 2007
Posts: 195
Default

venom@venom-desktop:~$ python email.py
File "email.py", line 4
from = raw_input("From: ")
^
SyntaxError: invalid syntax
venom@venom-desktop:~$


Haha.. I don't know how to format it.
Venom is offline   Reply With Quote
Old 04-09-2007, 11:55 PM   #15 (permalink)
Ipp
Administrator
 
Ipp's Avatar
 
Join Date: Feb 2007
Location: Maryland
Posts: 1,983
Send a message via AIM to Ipp Send a message via MSN to Ipp Send a message via Skype™ to Ipp
Default

I think the variable from may have a probelm try fromaddy or something. Same with to.
Ipp is offline   Reply With Quote
Old 04-10-2007, 12:00 AM   #16 (permalink)
Venom
Ninja Tutorialist
 
Join Date: Mar 2007
Posts: 195
Default

Quote:
Originally Posted by Ipp View Post
I think the variable from may have a probelm try fromaddy or something. Same with to.
You're right again.. but now another one haha

Code:
venom@venom-desktop:~$ python email.py
  File "email.py", line 8
    while 1
          ^
SyntaxError: invalid syntax
venom@venom-desktop:~$

I need to learn python.. it seems like an amazing language.. I didn't see much use to it in windows.. but I see it in linux.

Btw... I freaking love ubuntu
Venom is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://forums.tutorialninjas.net/tech-talk/93-sms-server.html
Posted By For Type Date
Tutorial Ninjas » Blog Archive » The Hidden Features of Text Messaging. This thread Refback 04-12-2007 03:20 AM


All times are GMT -4. The time now is 05:20 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0