import poplib
M = poplib.POP3_SSL('pop3.live.com', 995) #Connect to hotmail pop3 server
try:
M.user(raw_input("username: ")) #Get the username from the standar input
M.pass_(raw_input("password: ")) #Get the password from the standar input
except:
print "username or password incorrect"
else:
print "Successful login"
import smtplib
msg = "warning"
msg['From'] = "[email protected]"
msg['To'] = "[email protected]"
msg['Subject'] = "hello"
s = smtplib.SMTP("smtp.live.com",25)
s.sendmail("[email protected]", "[email protected]", msg.as_string())
s.quit()
我意識到如何使用python登錄hotmail。如何使用python在hotmail中編寫郵件?
但我仍然無法在hotmail中發送電子郵件。
TypeError: 'str' object does not support item assignment This keep coming up. I have no idea why.
有誰知道如何編寫下面的代碼。 Plz的幫助。我會很欣賞這一點。
究竟是什麼樣的軟件,你的工作嗎? – pajton