how to send mail async in python 3

1,215 views
Skip to first unread message

Carlo Restelli

unread,
Oct 8, 2013, 8:26:18 AM10/8/13
to python-...@googlegroups.com
Hi,

I'm developing an app, but i need your help :P

I'm using Python 3.3.2, tornado and motor with mongoDB. The user can create certain reports, and I need a way to send a mail with a pdf (smaller than you think). the customer has to use his own smtp server for the sending. Probably I need an async smtp client, I couldn't find anything. I need this thing, so if it's the only way Im going to write it. Any suggestion on how it has to work? any resource?

I need some guidance :)

Carlo

aliane abdelouahab

unread,
Oct 8, 2013, 8:40:35 AM10/8/13
to python-...@googlegroups.com

Carlo Restelli

unread,
Oct 8, 2013, 8:55:04 AM10/8/13
to python-...@googlegroups.com
yeah, 

it doesn't work

>>> import tornadomail
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tornadomail/__init__.py", line 30
    except ImportError, e:
                      ^
SyntaxError: invalid syntax

Waldecir Santos

unread,
Oct 8, 2013, 8:58:58 AM10/8/13
to python-...@googlegroups.com
i have created a separeted process to consume a queue, and used redis async to publish in this queue.

Grato,

Waldecir


--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Carlo Restelli

unread,
Oct 8, 2013, 10:42:39 AM10/8/13
to python-...@googlegroups.com
For I/O bound it's probably better multithreading, anyway it's not really async code. Am I wrong?

Carlo Restelli

unread,
Oct 9, 2013, 10:40:33 AM10/9/13
to python-...@googlegroups.com
Instead of a Queue I think I'll use futures, with the ProcessPoolExecutor or ThreadPoolExecutor. I'm probably going with processes to avoid locks etc. what do you think?
Reply all
Reply to author
Forward
0 new messages