Your other option, assuming you don't mind Windows specific code, is to use the CDONTS COM library:
import win32com.client
def SendEmail(email Addresses, subject, body, files):
iConf = win32com.client .Dispatch("CDO. Configuration")
Flds = iConf.Fields
Flds("http://schemas.microso ft.com/cdo/configuration/smtpserver").Va lue = "someserver "
Flds("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ).Value = 25
Flds("http://schemas.microso ft.com/cdo/configuration/sendusing").Val ue = 2 # cdoSendUsingPor t
# Authentication and stuff
Flds('http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e').Value = 0 # No authentication
# The following fields are only used if the previous authentication value is set to 1 or 2
# Flds('http://schemas.microso ft.com/cdo/configuration/smtpaccountname ').Value = "user"
# Flds('http://schemas.microso ft.com/cdo/configuration/sendusername'). Value = "domain\\us er"
# Flds('http://schemas.microso ft.com/cdo/configuration/sendpassword'). Value = "password"
Flds.Update()
iMsg = win32com.client .Dispatch("CDO. Message")
iMsg.Configurat ion = iConf
iMsg.To = ";".join(emailA ddresses)
iMsg.From = "Test<te**@test .com>"
iMsg.Subject = subject
iMsg.TextBody = body
# The following assumes the files to be in the current directory
for file in files:
iMsg.AddAttachm ent("file:///" + os.getcwd() + "/" + file)
iMsg.Send()
Felix.
Hello:
Could you tell me How I can send an email using
WIN2000? What do I need?
Thanks