Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

发送邮件失败 #9

Open
enteguo opened this issue Sep 17, 2020 · 2 comments
Open

发送邮件失败 #9

enteguo opened this issue Sep 17, 2020 · 2 comments

Comments

@enteguo
Copy link

enteguo commented Sep 17, 2020

2020-09-17 11:12:07 自动签到成功

2020-09-17 11:12:07 正在发送邮件通知。。。

Starting new HTTP connection (1): www.zimo.wiki:8080

http://www.zimo.wiki:8080 "POST /mail-sender/sendMail HTTP/1.1" 200 None

2020-09-17 11:12:08 发送邮件通知失败。。。

2020-09-17 11:12:08 {'msg': 'Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535 Login Fail. Please enter your authorization code to login. More information in http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256\n', 'code': 1}

END RequestId: d61d184d-65bf-4031-b7b5-bc82b098ff39

Report RequestId: d61d184d-65bf-4031-b7b5-bc82b098ff39 Duration:1923ms Memory:128MB MemUsage:56.179688MB

@mrjesen
Copy link
Contributor

mrjesen commented Sep 17, 2020

我直接把那个函数去掉了

@Nihosijie
Copy link

我直接改成server酱的推送了,把你的key填到key里面
def sendMessage(send, msg):
if send != '':
log('正在用server酱进行推送')
key = "SCU113348T6d16c8e82138d2815f5c47e8ab630"

    url = "https://sc.ftqq.com/%s.send" % (key)
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'}
    payload = {'text': '今日校园疫情上报自动填表结果通知', 'desp': getTimeStr() + str(msg)}
    res = requests.post(url, params=payload, headers=headers)
    errmsg =res.json()['errmsg']
    if errmsg == 'success':
        log('server酱通知成功')
    else:
        log('推送失败')
        log(res.json())

下面也根据自己需要稍作修改

            if msg == 'SUCCESS':
                log('自动提交成功!')
                sendMessage(user['user']['email'], '自动填写提交成功!')
            elif msg == '该收集已填写无需再次填写':
                log('今日已提交!')
                sendMessage(user['user']['email'], msg)
            else:
                log('自动提交失败。。。')
                log('错误是' + msg)
                sendMessage(user['user']['email'], '自动提交失败!错误是' + msg)
                exit(-1)

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

3 participants