
    %
iT                     b    d Z ddlmZmZ 	 ddZedk    rdZdZdZd	Z	 ee	eee
           dS dS )zImodule to send mail with Extended MAPI using the pywin32 mapi wrappers...    )mapimapitags Nc                    t          j        d           t          j        d|dt           j        t           j        z            }|                    d          }|                    t          j        t          j	        t          j
        fd           	 |                    dd          }t          |          dk    rn|d         }	t          j
        df|	v rnD|	\  \  }
}\  }}\  }}|                    d|dt           j        t           j        z            }|                    t          j        d          \  }}|d         \  }}t          j        |          t          j        k    rt)          d|z            |                    |dt           j                  }|                    dd          }g }d |r4|                    fd|                    d          D                        |r4|                    fd	|                    d          D                        |r4|                    fd
|                    d          D                        |                    t           j        |           |                    t          j        |ft          j        | fg           |                    d           |                    d           dS )zSends an email to the recipient using the extended MAPI interface
    Subject and Message are strings
    Send{To,CC,BCC} are comma-separated address lists
    MAPIProfile is the name of the MAPI profileNr   T   z%got PT_ERROR instead of PT_BINARY: %sc                     t           j        |ft           j        dft           j        dft           j        dft           j        | ft           j        dft           j        | ffS )NFr      SMTP)r   PR_RECIPIENT_TYPEPR_SEND_RICH_INFOPR_DISPLAY_TYPEPR_OBJECT_TYPEPR_EMAIL_ADDRESS_APR_ADDRTYPE_APR_DISPLAY_NAME_A)	recipientrecipienttypes     C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\win32comext/mapi/demos/mapisend.py	makeentryz SendEMAPIMail.<locals>.makeentry;   sY    '7'/%q)$a(()4#V,'3
 	
    c                 <    g | ]} |t           j                  S  )r   MAPI_TO.0r   r   s     r   
<listcomp>z!SendEMAPIMail.<locals>.<listcomp>H   '    SSSIYYy$,//SSSr   ,c                 <    g | ]} |t           j                  S r   )r   MAPI_CCr   s     r   r   z!SendEMAPIMail.<locals>.<listcomp>L   r   r   c                 <    g | ]} |t           j                  S r   )r   MAPI_BCCr   s     r   r   z!SendEMAPIMail.<locals>.<listcomp>P   s'    UUUYYYy$-00UUUr   ) r   MAPIInitializeMAPILogonExMAPI_EXTENDEDMAPI_USE_DEFAULTGetMsgStoresTable
SetColumnsr   
PR_ENTRYIDr   PR_DEFAULT_STORE	QueryRowslenOpenMsgStoreMDB_NO_DIALOGMAPI_BEST_ACCESSGetPropsPR_IPM_OUTBOX_ENTRYID	PROP_TYPEPT_ERROR	TypeError	OpenEntryCreateMessageextendsplitModifyRecipientsMODRECIP_ADDSetProps	PR_BODY_APR_SUBJECT_ASaveChangesSubmitMessage)SubjectMessageSendToSendCCSendBCCMAPIProfilesessionmessagestorestablerowsroweid_tageidname_tagnamedef_store_tag	def_storemsgstorehrpropstagoutboxfoldermessagepalr   s                          @r   SendEMAPIMailrW      s    		;d043HH G !22155!!		h8(:STVW  !++Aq11t99>>1g%t,33 DG@NWc$Xt&@}i##	3d(4+@@ H
 !!8#AAFFIBqJS##("333?#EFFF%%c41FGGL ((q11G
C	
 	
 	
  


SSSScARARSSS	
 	
 	
  


SSSScARARSSS	
 	
 	
  


UUUU'--PSBTBTUUU	
 	
 	

 T.444x)73h6KW5UVWWW Q!r   __main__zan.invalid at addressztesting one two threezTesting Extended MAPI!!)rE   )r   r   NNNN)
__doc__win32com.mapir   r   rW   __name__rE   rB   SendMessageSendSubjectr   r   r   <module>r^      s    P O ) ( ( ( ( ( ( ( QUM M M M` zK$F)K+KM+{FLLLLLL r   