修复邮件系统保存邮件的问题:1. 添加邮箱ID查询逻辑 2. 调整SMTP客户端连接方式
This commit is contained in:
@@ -49,7 +49,8 @@ def send_verification_email(smtp_host, smtp_port, to_email):
|
||||
|
||||
# 连接SMTP服务器并发送
|
||||
try:
|
||||
server = smtplib.SMTP(smtp_host, smtp_port)
|
||||
# 使用显式的源地址
|
||||
server = smtplib.SMTP(smtp_host, smtp_port, timeout=30, source_address=('127.0.0.1', 0))
|
||||
server.set_debuglevel(1) # 开启调试模式
|
||||
print(f"连接到SMTP服务器: {smtp_host}:{smtp_port}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user