/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/util/simplemapi.py

  • Committer: Robert Collins
  • Date: 2007-10-05 02:41:37 UTC
  • mto: (2592.3.166 repository)
  • mto: This revision was merged to the branch mainline in revision 2896.
  • Revision ID: robertc@robertcollins.net-20071005024137-kn7brcu07nu8cwl1
* The class ``bzrlib.repofmt.knitrepo.KnitRepository3`` has been folded into
  ``KnitRepository`` by parameters to the constructor. (Robert Collins)
* ``bzrlib.xml_serializer.Serializer`` is now responsible for checking that
  mandatory attributes are present on serialisation and deserialisation.
  This fixes some holes in API usage and allows better separation between
  physical storage and object serialisation. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
Origin  : Based on the original script by Ian Cook
29
29
          http://www.kirbyfooty.com/simplemapi.py
30
30
Comments: Works (and tested) with:
31
 
          Outlook Express, Outlook 97 and 2000,
 
31
          Outlook Express, Outlook 97 and 2000, 
32
32
          Eudora, Incredimail and Mozilla Thunderbird (1.5.0.2)
33
33
Thanks  : Werner F. Bruhin and Michele Petrazzo on the ctypes list.
34
34
 
35
 
If you have any bug-fixes, enhancements or suggestions regarding this
 
35
If you have any bug-fixes, enhancements or suggestions regarding this 
36
36
software, please contact me at the above email address.
37
37
"""
38
38
 
181
181
 
182
182
def _sendMail(session, recipient, subject, body, attach):
183
183
    nFileCount = len(attach)
184
 
    if attach:
185
 
        MapiFileDesc_A = MapiFileDesc * len(attach)
186
 
        fda = MapiFileDesc_A()
187
 
        for fd, fa in zip(fda, attach):
188
 
            fd.ulReserved = 0
189
 
            fd.flFlags = 0
190
 
            fd.nPosition = -1
191
 
            fd.lpszPathName = fa
192
 
            fd.lpszFileName = None
193
 
            fd.lpFileType = None
 
184
    if attach: 
 
185
        MapiFileDesc_A = MapiFileDesc * len(attach) 
 
186
        fda = MapiFileDesc_A() 
 
187
        for fd, fa in zip(fda, attach): 
 
188
            fd.ulReserved = 0 
 
189
            fd.flFlags = 0 
 
190
            fd.nPosition = -1 
 
191
            fd.lpszPathName = fa 
 
192
            fd.lpszFileName = None 
 
193
            fd.lpFileType = None 
194
194
        lpFiles = fda
195
195
    else:
196
196
        lpFiles = lpMapiFileDesc()
197
197
 
198
198
    RecipWork = recipient.split(';')
199
199
    RecipCnt = len(RecipWork)
200
 
    MapiRecipDesc_A = MapiRecipDesc * len(RecipWork)
201
 
    rda = MapiRecipDesc_A()
 
200
    MapiRecipDesc_A = MapiRecipDesc * len(RecipWork) 
 
201
    rda = MapiRecipDesc_A() 
202
202
    for rd, ra in zip(rda, RecipWork):
203
 
        rd.ulReserved = 0
 
203
        rd.ulReserved = 0 
204
204
        rd.ulRecipClass = MAPI_TO
205
205
        try:
206
206
            rd.lpszName, rd.lpszAddress = _resolveName(session, ra)
222
222
 
223
223
def SendMail(recipient, subject="", body="", attachfiles=""):
224
224
    """Post an e-mail message using Simple MAPI
225
 
 
 
225
    
226
226
    recipient - string: address to send to (multiple addresses separated with a semicolon)
227
227
    subject   - string: subject header
228
228
    body      - string: message text