Show
Ignore:
Timestamp:
07/05/07 15:23:03 (16 months ago)
Author:
Tarek Ziad?? <tarek@…>
Message:

finalized v1

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mailer/doc/mailer.txt

    r134 r136  
    1919    >>> from sender import send_mail 
    2020    >>> mail_id = send_mail(sender='tarek@ziade.org', 
    21     ...                     recipients=['tarek@ziade.org'], 
     21    ...                     recipients=['ziade.tarek@gmail.com'], 
    2222    ...                     subject='hello', 
    23     ...                     msg='hello') 
     23    ...                     msg='héllo') 
    2424 
    2525 
     
    3131    >>> from sender import mail_status 
    3232    >>> mail_status(mail_id) 
    33     'processing' 
     33    u'processing' 
     34 
     35When the id is not given, the whole mailed table is returned:: 
     36 
     37    >>> mail_status() 
     38    [] 
     39 
     40We can ask for the queue size as well:: 
     41 
     42    >>> from sender import mail_queue_size 
     43    >>> mail_queue_size() 
     44    1 
     45 
     46 
    3447 
    3548sending mails, for real 
     
    4659 
    4760    >>> import time 
    48     >>> while mail_status(mail_id) == 'processing': 
     61    >>> while mail_status(mail_id) == u'processing': 
    4962    ...     time.sleep(0.2) 
    5063    >>> mail_status(mail_id) 
     
    5568    >>> stop_server() 
    5669 
     70And see the status:: 
    5771 
     72    >>> status = mail_status() 
     73    >>> status[0]['subject'] 
     74    u'hello' 
     75    >>> status[0]['status'] 
     76    u'processed' 
    5877