UtilityLibAPI 1.2512.503__tar.gz → 1.2512.801__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.
Files changed (16) hide show
  1. {utilitylibapi-1.2512.503/src/UtilityLibAPI.egg-info → utilitylibapi-1.2512.801}/PKG-INFO +5 -1
  2. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/README.md +4 -0
  3. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/pyproject.toml +1 -1
  4. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/MailSenderLib.py +22 -18
  5. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801/src/UtilityLibAPI.egg-info}/PKG-INFO +5 -1
  6. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/LICENSE +0 -0
  7. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/setup.cfg +0 -0
  8. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/Archive7zLib.py +0 -0
  9. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/EnDeCodeLib.py +0 -0
  10. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/ExtWrapper7zLib.py +0 -0
  11. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/SessionVARLib.py +0 -0
  12. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI/__init__.py +0 -0
  13. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI.egg-info/SOURCES.txt +0 -0
  14. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI.egg-info/dependency_links.txt +0 -0
  15. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI.egg-info/requires.txt +0 -0
  16. {utilitylibapi-1.2512.503 → utilitylibapi-1.2512.801}/src/UtilityLibAPI.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UtilityLibAPI
3
- Version: 1.2512.503
3
+ Version: 1.2512.801
4
4
  Summary: UtilityLibAPI Python package
5
5
  Author-email: James Lin <tylin123@ms27.hinet.net>
6
6
  License: Copyright (c) 2025 James Lin **UtilityLibAPI**
@@ -33,6 +33,10 @@ Dynamic: license-file
33
33
  #UtilityLibAPI Classes
34
34
 
35
35
  ## History of version
36
+ Version 1.2512.0801: 2025/12/08<BR>
37
+ Modify CUF_Open() function for multi user accounts.
38
+
39
+
36
40
  Version 1.2512.0501: 2025/12/05<BR>
37
41
  Fixed break down when smtp server not auth or response time out.
38
42
 
@@ -1,6 +1,10 @@
1
1
  #UtilityLibAPI Classes
2
2
 
3
3
  ## History of version
4
+ Version 1.2512.0801: 2025/12/08<BR>
5
+ Modify CUF_Open() function for multi user accounts.
6
+
7
+
4
8
  Version 1.2512.0501: 2025/12/05<BR>
5
9
  Fixed break down when smtp server not auth or response time out.
6
10
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "UtilityLibAPI"
7
- version = "1.2512.0503"
7
+ version = "1.2512.0801"
8
8
  description = "UtilityLibAPI Python package"
9
9
  authors = [
10
10
  { name="James Lin", email="tylin123@ms27.hinet.net" }
@@ -25,11 +25,11 @@ class CLASS_MailSender:
25
25
  :param Pms_Password: 登入密碼或應用程式密碼
26
26
  :param Pmb_UseSSL: 是否使用 SSL 連線 (預設 True)
27
27
  """
28
- self.Pms_SMTP_Server = Pms_SMTP_Server
29
- self.Pmi_Port = Pmi_Port
30
- self.Pms_Account = Pms_Account
31
- self.Pms_Password = Pms_Password
32
- self.Pmb_UseSSL = Pmb_UseSSL
28
+ self.CVms_SMTP_Server = Pms_SMTP_Server
29
+ self.CVmi_Port = Pmi_Port
30
+ self.CVms_Account = Pms_Account # 登入帳號
31
+ self.CVms_Password = Pms_Password # 登入密碼
32
+ self.CVmb_UseSSL = Pmb_UseSSL
33
33
  # ======================================================================
34
34
  # 新增事件
35
35
  # ======================================================================
@@ -58,20 +58,23 @@ class CLASS_MailSender:
58
58
  # ================================================================================
59
59
  # ⭐⭐⭐ 新增函數:CUF_Open() ⭐⭐⭐
60
60
  # ================================================================================
61
- def CUF_Open(self) -> bool:
61
+ def CUF_Open(self, Pms_Account:str, Pms_PassWD:str) -> bool:
62
62
  """建立 SMTP 連線(長連線模式)"""
63
+ self.CVms_Account = Pms_Account;
64
+ self.CVms_Password = Pms_PassWD;
65
+ # ------------------------------------------------------------
63
66
  try:
64
67
  if self.CVobj_Server:
65
68
  return True
66
69
 
67
- if self.Pmb_UseSSL:
68
- server = smtplib.SMTP_SSL(self.Pms_SMTP_Server, self.Pmi_Port)
70
+ if self.CVmb_UseSSL:
71
+ server = smtplib.SMTP_SSL(self.CVms_SMTP_Server, self.CVmi_Port)
69
72
  else:
70
- server = smtplib.SMTP(self.Pms_SMTP_Server, self.Pmi_Port)
73
+ server = smtplib.SMTP(self.CVms_SMTP_Server, self.CVmi_Port)
71
74
  server.ehlo()
72
75
  server.starttls()
73
76
 
74
- server.login(self.Pms_Account, self.Pms_Password)
77
+ server.login(self.CVms_Account, self.CVms_Password)
75
78
  self.CVobj_Server = server
76
79
  return True
77
80
  except Exception as e:
@@ -102,7 +105,8 @@ class CLASS_MailSender:
102
105
  def CUF_Reconnect(self) -> bool:
103
106
  """強制重新連線"""
104
107
  self.CUF_Close()
105
- return self.CUF_Open()
108
+ return self.CUF_Open(Pms_Account = self.CVms_Account,
109
+ Pms_PassWD = self.CVms_Password);
106
110
 
107
111
 
108
112
  #------------------------------------------------------------
@@ -121,7 +125,7 @@ class CLASS_MailSender:
121
125
  msg = MIMEMultipart("alternative")
122
126
 
123
127
  # 設定寄件者別名
124
- from_addr = formataddr((Pms_From or self.Pms_Account, self.Pms_Account))
128
+ from_addr = formataddr((Pms_From or self.CVms_Account, self.CVms_Account))
125
129
  msg["From"] = from_addr
126
130
 
127
131
  msg["To"] = ", ".join(Pobj_To or [])
@@ -193,18 +197,18 @@ class CLASS_MailSender:
193
197
  )
194
198
 
195
199
  all_recipients = (Pobj_To or []) + (Pobj_Cc or []) + (Pobj_Bcc or [])
196
- from_addr = formataddr((Pms_From or self.Pms_Account, self.Pms_Account))
200
+ from_addr = formataddr((Pms_From or self.CVms_Account, self.CVms_Account))
197
201
 
198
202
  try:
199
- if self.Pmb_UseSSL:
200
- with smtplib.SMTP_SSL(self.Pms_SMTP_Server, self.Pmi_Port) as server:
201
- server.login(self.Pms_Account, self.Pms_Password)
203
+ if self.CVmb_UseSSL:
204
+ with smtplib.SMTP_SSL(self.CVms_SMTP_Server, self.CVmi_Port) as server:
205
+ server.login(self.CVms_Account, self.CVms_Password)
202
206
  server.sendmail(from_addr, all_recipients, msg.as_string())
203
207
  else:
204
- with smtplib.SMTP(self.Pms_SMTP_Server, self.Pmi_Port) as server:
208
+ with smtplib.SMTP(self.CVms_SMTP_Server, self.CVmi_Port) as server:
205
209
  server.ehlo()
206
210
  server.starttls()
207
- server.login(self.Pms_Account, self.Pms_Password)
211
+ server.login(self.CVms_Account, self.CVms_Password)
208
212
  server.sendmail(from_addr, all_recipients, msg.as_string())
209
213
 
210
214
  print("✅ Send Success!")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UtilityLibAPI
3
- Version: 1.2512.503
3
+ Version: 1.2512.801
4
4
  Summary: UtilityLibAPI Python package
5
5
  Author-email: James Lin <tylin123@ms27.hinet.net>
6
6
  License: Copyright (c) 2025 James Lin **UtilityLibAPI**
@@ -33,6 +33,10 @@ Dynamic: license-file
33
33
  #UtilityLibAPI Classes
34
34
 
35
35
  ## History of version
36
+ Version 1.2512.0801: 2025/12/08<BR>
37
+ Modify CUF_Open() function for multi user accounts.
38
+
39
+
36
40
  Version 1.2512.0501: 2025/12/05<BR>
37
41
  Fixed break down when smtp server not auth or response time out.
38
42