Hello, I'm making a script that daily grabs some information and email
it to some of my coworkers. It runs all the other parts while I'm
logged off, but this part doesn't. I need to be logged on for it to
work. Also, when I'm logged on to my Windows XP I just can't make it
send. It only sits in my mailbox. I have to manually press "send" to
get it sent.
here is the code that won't work:
import win32com.client
try:
s = win32com.client.Dispatch("Mapi.Session")
s.Logon("Default")
Msg = s.Outbox.Messages.Add("Daily Activity Report", report)
testaddresses = [
'[email protected]',
## '[email protected]',
## '[email protected]',
## '[email protected]',
]
for address in testaddresses:
Msg.Recipients.Add(address)
Msg.Send()
s.DeliverNow()
s.Logoff()
except:
logfile.write("Couldn't write email")
#===
So, I'm coming to a conclusion that it is not possible to send emails
while logged off.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor