PythonのIDE【統合開発環境】である「PyCharm」では、「IDE 機能を学習」というものがあり、便利なショートカットが多く紹介されていたので、まとめておきます。
Python の IDE 機能を学習
オンボーディングツアー
プロジェクトビューを開くAlt + 1
警告をプレビュー / コンテキストアクションの表示Alt + Enter
どこでも検索Shift 2回押…
import smtplib
from email.mime.text import MIMEText
smtp_setting = {
'host': 'xxxxx.xserver.jp',
'port': 465,
'account': 'sample@dattesar.com',
'password': 'dattesar_pass'
}
email_content = {
'To': 'test@dattesar.com',
'From': 'sample@dattesar.com',
'Subject': 'テストメール',
'Text': 'このメールはPythonで送信しています。'
}
msg = MIMEText(email_content['Text'], 'plain', 'utf-8')
msg['Subject'] = email_content['Subject']
msg['From'] = email_content['From']
msg['To'] = email_content['To']
with smtplib.SMTP_SSL(smtp_setting['host'], smtp_setting['port'], timeout=10) as smtp:
smtp.login(smtp_setting['account'], smtp_setting['password'])
smtp.send_message(msg)
smtp.quit()
graffiti on the web
この投稿へのコメント
コメントはまだありません。