PyEmailerAJM 1.3__tar.gz → 1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PKG-INFO +2 -2
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM/PyEmailerAJM.py +36 -1
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM.egg-info/PKG-INFO +2 -2
- PyEmailerAJM-1.4/README.md +15 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/setup.py +2 -2
- PyEmailerAJM-1.3/README.md +0 -10
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/LICENSE.txt +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM/__init__.py +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM.egg-info/SOURCES.txt +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM.egg-info/dependency_links.txt +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM.egg-info/requires.txt +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/PyEmailerAJM.egg-info/top_level.txt +0 -0
- {PyEmailerAJM-1.3 → PyEmailerAJM-1.4}/setup.cfg +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4
|
|
4
4
|
Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
|
|
5
5
|
Home-page: https://github.com/amcsparron2793-Water/PyEmailer
|
|
6
6
|
Author: Amcsparron
|
|
7
7
|
Author-email: amcsparron@albanyny.gov
|
|
8
8
|
License: MIT License
|
|
9
|
-
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.
|
|
9
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.4.tar.gz
|
|
10
10
|
Keywords: Outlook,Email,Automation
|
|
11
11
|
Platform: UNKNOWN
|
|
12
12
|
License-File: LICENSE.txt
|
|
@@ -4,7 +4,8 @@ PyEmailerAJM.py
|
|
|
4
4
|
|
|
5
5
|
install win32 with pip install pywin32
|
|
6
6
|
"""
|
|
7
|
-
from os
|
|
7
|
+
from os import environ
|
|
8
|
+
from os.path import isfile, abspath, isabs, join, isdir
|
|
8
9
|
|
|
9
10
|
# imports
|
|
10
11
|
|
|
@@ -22,9 +23,12 @@ class EmailerNotSetupError(Exception):
|
|
|
22
23
|
class PyEmailer:
|
|
23
24
|
# the email tab_char
|
|
24
25
|
tab_char = ' '
|
|
26
|
+
signature_dir_path = join((environ['USERPROFILE']),
|
|
27
|
+
'AppData\\Roaming\\Microsoft\\Signatures\\')
|
|
25
28
|
|
|
26
29
|
def __init__(self, display_window: bool,
|
|
27
30
|
send_emails: bool, logger: Logger = None,
|
|
31
|
+
email_sig_filename: str = None,
|
|
28
32
|
auto_send: bool = False,
|
|
29
33
|
email_app_name: str = 'outlook.application'):
|
|
30
34
|
|
|
@@ -54,6 +58,37 @@ class PyEmailer:
|
|
|
54
58
|
self._logger.error(e, exc_info=True)
|
|
55
59
|
raise e
|
|
56
60
|
|
|
61
|
+
self._email_signature = None
|
|
62
|
+
self.email_sig_filename = email_sig_filename
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def email_signature(self):
|
|
66
|
+
return self._email_signature
|
|
67
|
+
|
|
68
|
+
@email_signature.getter
|
|
69
|
+
def email_signature(self):
|
|
70
|
+
signature_full_path = join(self.signature_dir_path, self.email_sig_filename)
|
|
71
|
+
if isdir(self.signature_dir_path):
|
|
72
|
+
pass
|
|
73
|
+
else:
|
|
74
|
+
try:
|
|
75
|
+
raise NotADirectoryError(f"{self.signature_dir_path} does not exist.")
|
|
76
|
+
except NotADirectoryError as e:
|
|
77
|
+
self._logger.warning(e)
|
|
78
|
+
self._email_signature = None
|
|
79
|
+
|
|
80
|
+
if isfile(signature_full_path):
|
|
81
|
+
with open(signature_full_path, 'r', encoding='utf-16') as f:
|
|
82
|
+
self._email_signature = f.read().strip()
|
|
83
|
+
else:
|
|
84
|
+
try:
|
|
85
|
+
raise FileNotFoundError(f"{signature_full_path} does not exist.")
|
|
86
|
+
except FileNotFoundError as e:
|
|
87
|
+
self._logger.warning(e)
|
|
88
|
+
self._email_signature = None
|
|
89
|
+
|
|
90
|
+
return self._email_signature
|
|
91
|
+
|
|
57
92
|
def _GetReadFolder(self, email_dir_index: int = 6):
|
|
58
93
|
# 6 = inbox
|
|
59
94
|
self.read_folder = self._mapi_ns.GetDefaultFolder(email_dir_index)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyEmailerAJM
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4
|
|
4
4
|
Summary: Allows for automating sending Email with the Outlook Desktop client. Future releases will add more client support
|
|
5
5
|
Home-page: https://github.com/amcsparron2793-Water/PyEmailer
|
|
6
6
|
Author: Amcsparron
|
|
7
7
|
Author-email: amcsparron@albanyny.gov
|
|
8
8
|
License: MIT License
|
|
9
|
-
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.
|
|
9
|
+
Download-URL: https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.4.tar.gz
|
|
10
10
|
Keywords: Outlook,Email,Automation
|
|
11
11
|
Platform: UNKNOWN
|
|
12
12
|
License-File: LICENSE.txt
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# <u>PyEmailerAJM</u>
|
|
2
|
+
### <i>Makes automating Outlook emails quick and easy</i>
|
|
3
|
+
|
|
4
|
+
- PyEmailerAJM uses pywin32 to automate the sending/reading of Outlook emails.
|
|
5
|
+
|
|
6
|
+
**Import**
|
|
7
|
+
|
|
8
|
+
- import PyEmailer class using `from PyEmailerAJM.PyEmailerAJM import PyEmailer`
|
|
9
|
+
|
|
10
|
+
**Notes**
|
|
11
|
+
|
|
12
|
+
- see [OutlookPywin32Commands.xlsx](OutlookPywin32Commands.xlsx) for list of commands that can be used with a message object.
|
|
13
|
+
|
|
14
|
+
- Email signature **text** can now be added as of v1.4
|
|
15
|
+
- Assuming the signature *.txt file is found in `%APPDATA%/Microsoft/Signatures/`
|
|
@@ -2,10 +2,10 @@ from setuptools import setup
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='PyEmailerAJM',
|
|
5
|
-
version='1.
|
|
5
|
+
version='1.4',
|
|
6
6
|
packages=['PyEmailerAJM'],
|
|
7
7
|
url='https://github.com/amcsparron2793-Water/PyEmailer',
|
|
8
|
-
download_url='https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.
|
|
8
|
+
download_url='https://github.com/amcsparron2793-Water/PyEmailer/archive/refs/tags/1.4.tar.gz',
|
|
9
9
|
keywords=["Outlook", "Email", "Automation"],
|
|
10
10
|
install_requires=['pywin32'],
|
|
11
11
|
license='MIT License',
|
PyEmailerAJM-1.3/README.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# <u>PyEmailerAJM</u>
|
|
2
|
-
### <i>Makes automating Outlook emails quick and easy</i>
|
|
3
|
-
|
|
4
|
-
- PyEmailerAJM uses pywin32 to automate the sending/reading of Outlook emails.
|
|
5
|
-
|
|
6
|
-
<b>Import</b>
|
|
7
|
-
|
|
8
|
-
import PyEmailer class using `from PyEmailerAJM.PyEmailerAJM import PyEmailer`
|
|
9
|
-
|
|
10
|
-
see [OutlookPywin32Commands.xlsx](OutlookPywin32Commands.xlsx) for list of commands that can be used with a message object.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|