Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

建议改用outlook邮箱,注册方便,配置方便,仅需账号和密码就能登录 #5

Closed
ayyayyayy2002 opened this issue Sep 3, 2024 · 7 comments

Comments

@ayyayyayy2002
Copy link

建议改用outlook邮箱,注册方便,配置方便,仅需账号和密码就能登录
示例代码:

import smtplib
import os
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

# 读取邮箱配置文件
file_path = os.path.join('附加文件', 'emailconfig.txt')
recipient_email = 'help@bilibili.com'  # 替换为目标邮件地址
subject = '你的邮件主题'
content = '这是要发送的邮件内容'

with open(file_path, 'r', encoding='utf-8') as f:
    lines = f.readlines()

if len(lines) % 2 != 0:
    print("文件格式错误,请检查邮箱和密码是否成对出现。")
else:
    for i in range(0, len(lines), 2):
        email = lines[i].strip()  # 获取邮箱
        password = lines[i + 1].strip()  # 获取密码

        try:
            # 创建邮件对象
            msg = MIMEMultipart()
            msg['From'] = email
            msg['To'] = recipient_email
            msg['Subject'] = subject

            # 邮件正文
            msg.attach(MIMEText(content, 'plain'))

            # 连接到Outlook SMTP服务器并发送邮件
            with smtplib.SMTP('smtp.office365.com', 587) as server:
                server.starttls()  # 启用TLS加密
                server.login(email, password)  # 登录
                server.send_message(msg)  # 发送邮件

            print(f"成功发送邮件:{email}")
        except Exception as e:
            print(f"发送失败,邮箱:{email},错误信息:{e}")

配置文件示例:

邮箱1
密码1
邮箱2
密码2
邮箱3
.........
@qaqFei
Copy link
Owner

qaqFei commented Sep 3, 2024

已采用, 现在BiliClear可理论支持所有邮箱, 之后需手动输入smtp服务器

@qaqFei qaqFei closed this as completed Sep 3, 2024
@ayyayyayy2002
Copy link
Author

已采用, 现在BiliClear可理论支持所有邮箱, 之后需手动输入smtp服务器

发送到官方邮箱不好使,可以发送到jubao@12377.cn,具体可以看我项目代码

@qaqFei
Copy link
Owner

qaqFei commented Sep 5, 2024

@qaqFei
Copy link
Owner

qaqFei commented Sep 5, 2024

思来想去, 举报到国家邮箱还是不太好

@qaqFei qaqFei closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
@qaqFei qaqFei closed this as completed Sep 5, 2024
@qaqFei
Copy link
Owner

qaqFei commented Sep 5, 2024

不好意思, 不小心点到了close

@ayyayyayy2002
Copy link
Author

不好意思, 不小心点到了close

牢b赚不到钱了,有意包庇这些人,举报到牢b就像在官方商城查看商品评价一样毫无意义,只有让牢b感受到压力才能有效果。
换个角度想,万一那个地址的收件箱一万年都没有人看呢?

@qaqFei
Copy link
Owner

qaqFei commented Sep 6, 2024

流量太大了可能会有法律责任(?) (我不清楚, 有点怕, 虽然在README里面声明了...)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants