kootenpv / aioyagmail

makes sending emails very easy by doing all the magic for you, asynchronously
MIT License
31 stars 3 forks source link

M1 芯片无法正常发送邮件 #1

Open Yingqingshan opened 2 years ago

Yingqingshan commented 2 years ago

Mac 电脑M1 芯片无法正常发送邮件

kootenpv commented 2 years ago

Without sharing any errors it is tough to help out though. Also I don't have an M1 so tough to help myself...

Yingqingshan commented 2 years ago
from aioyagmail import AIOSMTP
from config import configs

async def send_email(email: str, subject: str, content: str):
    async with AIOSMTP(
            user=configs.EMAIL_HOST_USER,
            password=configs.EMAIL_HOST_PASSWORD,
            host=configs.EMAIL_HOST,
            port=configs.EMAIL_PORT,
    ) as yag:
        try:
            res = await yag.send(to=email, subject=subject, contents=content)
            print(res)
            return True
        except:
            return False

if __name__ == '__main__':
    async def register():
        try:
            print('333333333333333')
            result = await send_email("462548187@qq.com", '123', '123')
        except:
            print('123')

    import asyncio
    loop = asyncio.get_event_loop()
    loop.run_until_complete(register())
    loop.close()
Yingqingshan commented 2 years ago

There is no error on Macbook with M1 chip

kootenpv commented 2 years ago

So what is the problem?