Yet another problem moving to Python 2.5: sending emails

15 views
Skip to first unread message

Don Dwiggins

unread,
Nov 18, 2008, 2:15:31 PM11/18/08
to pyins...@googlegroups.com
I've run into another snag with 2.5 (still under Windows XP), which I've
seen in both py2exe and pyinstaller. When I use smtplib to send an
email, the script successfully sends the message, but the compiled
version gets a 'Connection refused' error. Here's a sample program to
illustrate:

> 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

Don Dwiggins

unread,
Nov 18, 2008, 2:25:10 PM11/18/08
to pyins...@googlegroups.com
Never mind -- cockpit error. My virus scan program is blocking what it
thinks are spam email programs. (Blush!)

Giovanni Bajo

unread,
Nov 19, 2008, 7:58:12 AM11/19/08
to PyIns...@googlegroups.com
On Tue, 2008-11-18 at 11:25 -0800, Don Dwiggins wrote:
> Never mind -- cockpit error. My virus scan program is blocking what it
> thinks are spam email programs. (Blush!)

:) 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


Reply all
Reply to author
Forward
0 new messages