同様のトピックに関する投稿の1つで提案されているように、次のコードを使用して電子メールを送信しました。しかし、メールは送信されていません。助言がありますか?
import subprocess
recipient = 'xxxxx@gmail.com'
subject = 'test'
body = 'testing mail through python'
def send_message(recipient, subject, body):
process = subprocess.Popen(['mail', '-s', subject, recipient],
stdin=subprocess.PIPE)
process.communicate(body)
print("sent the email")