Commit 7e7c7e5a by stellaaachen

email

parent 46a578e4
Showing with 14 additions and 1 deletions
......@@ -26,7 +26,20 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"@app.route('/emails', methods = ['POST'])\n",
"def handle_request():\n",
" from email.message import EmailMessage\n",
" msg = EmailMessage()\n",
" msg.set_content('Hello World!')\n",
" msg['Subject'] = 'hi'\n",
" msg['From'] = \"classhooktest@gmail.com\"\n",
" msg['To'] = [request.json['email']]\n",
" server = smtplib.SMTP_SSL('smtp.gmail.com', 465)\n",
" server.login(\"classhooktest@gmail.com\", \"classhooktest2#\")\n",
" server.send_message(msg)\n",
" server.quit()"
]
},
{
"cell_type": "code",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment