> import smtplib
>
> address ='m...@here.tld'
>
> msg = '''From nobody Mon Nov 17 16:31:29 2008
> Subject: This is a test
> From: %s
> To: %s
>
> Hello, world!
> ''' % (address, address)
>
> smtp = smtplib.SMTP()
> smtp.connect(smtphost, smtpport)
> smtp.login(user, pwd)
> smtp.sendmail(address, address, msg)
> smtp.quit()
Here's the spec file I use:
> a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'),
> os.path.join(HOMEPATH,'support\\useUnicode.py'),
> 'test.py'],
> pathex=[r'C:\Dwig\tmp\pyinstaller']
> )
> pyz = PYZ(a.pure)
> exe = EXE( pyz,
> a.scripts,
> a.binaries,
> name='test.exe',
> debug=False,
> strip=False,
> upx=True,
> console=False )
> dist = COLLECT(exe,
> name='PyIdist')
And here's the result of running the exe:
> bash-3.2$ PyIdist/test.exe
> Traceback (most recent call last):
> File "<string>", line 18, in <module>
> File "c:\Dwig\Falcon\Development\Online\dev\RCAServer\smtptest\build\pyi.win32\test\outPYZ1.pyz/smtplib", line 310, in connect
> socket.error: (10061, 'Connection refused')
Any ideas?
--
Don Dwiggins
Advanced Publishing Technology
:) In fact, I'm sure I had used SMTP before within PyInstaller without
any trouble.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com