Metadata-Version: 2.1
Name: send-gmail
Version: 0.0.3
Summary: Send smtp mail
Author-email: Detlef Meyer <detlefm@dmone.de>
License: MIT License
        
        Copyright (c) 2022 Detlef Meyer, Germany
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/detlefm/send_gmail
Project-URL: Bug Tracker, https://github.com/detlefm/send_gmail/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# send_gmail
Python : Sending an email via smtp Server
Default smpt Server : gmail

usage:

```python
from send_gmail import SendGMail

html = '<html><body>Hello world </body></html>'
txt = 'Hello world as text'
subject = 'First message'
pdffile = r'c:\tmp\test.pdf'

smtpsrv = SendGMail(id='xxxx@gmail.com',pwd='977823490123')

"""
send

Args:
    from_addr (str | None): sender email, if None the id field is used   
    to_addr (list | str): receiver(s) email, string for one - list for many
    subject (str | None ): subject as utf-8 text, if None current date is send
    html (str, optional):html part of message. Defaults to None.
    text (str, optional): text part of message. Defaults to None.
    attachments (list | str, optional): files to attach. Defaults to None.

Returns:
    dict: dictionary of errors, key == to_addr, value == Error
"""

errs = smtpsrv.send(from_addr='xxxx@gmail.com', 
                                to_addr='yyyy@gmail.com', 
                                subject=subject, 
                                html=html, 
                                text = txt, 
                                attachments=pdffile)
                                
# or send just the current date as subject to yyyy@gmail.com
SendGMail(id='xxxx@gmail.com',pwd='977823490123').send(None,'yyyy@gmail.com')

```


