- Joined
- Oct 17, 2017
- Messages
- 1
- Reaction score
- 0
I am trying to send an email via python, but it does not work. Can someone give me a hint, what I am doing wrong here?
The problem is here:
c.Fields('cdoSMTPAuthenticate').Value = 2
also using "cdontlm" instead of "2" doesn't really help...
Python:
import win32com.client
c = win32com.client.Dispatch('CDO.Configuration')
c.Fields.Item('cdoSendUsingMethod').Value = 2
c.Fields.Item('cdoSMTPServer').Value = 'smtp.myserver.de'
c.Fields.Item('cdoSMTPConnectionTimeout').Value = 10
c.Fields('cdoSMTPServerPort').Value = 25
c.Fields('cdoSMTPAuthenticate').Value = 2
c.Fields.Update()
m = win32com.client.Dispatch('CDO.Message')
m.Configuration = c
m.To = '[email protected]'
m.From = 'Test'
m.Htmlbody = '<H3><B>this is a test</B></H3>'
m.Subject = 'Testigertest'
m.Send()
The problem is here:
c.Fields('cdoSMTPAuthenticate').Value = 2
also using "cdontlm" instead of "2" doesn't really help...