smtp icloud working config

This commit is contained in:
Chang CL
2025-08-22 10:24:01 +08:00
parent aef4a79de8
commit 52683bacdd

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "43f466e6-b25d-40ac-a36e-982650e3e8ed",
"metadata": {},
"outputs": [],
@@ -15,21 +15,10 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "45ec6b06-b667-46c2-9430-89f45b490c13",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# need to recall when edited\n",
"load_dotenv()"
@@ -37,19 +26,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "289d0ee8-21ca-4ab8-8514-2f6a248cd19f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"email to: cheeloychang@gmail.com\n",
"email from: spareclass@spareclass.com\n"
]
}
],
"outputs": [],
"source": [
"smtp_server = os.getenv(\"SMTP_SRV\")\n",
"smtp_port = os.getenv(\"SMTP_PORT\")\n",
@@ -64,21 +44,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "7e57d507-242f-4c9b-9acc-557dd9429966",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(235, b'2.7.0 Authentication successful')"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"server = smtplib.SMTP(smtp_server, smtp_port)\n",
"server.starttls()\n",
@@ -87,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "97b89233-abb9-4d51-aa3e-5d32c3be34ab",
"metadata": {},
"outputs": [],