You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I am simply trying to send mail using smtplib.
I added the certificate to the smtp container, and when I ran that code, this '550, b'relay not permitted' occurred. It seems that it cannot be received from other receiving servers.
Please help.
Thank you.
import mail
from flask import Flask, request, Response, jsonify
import smtplib
app = Flask(__name__)
@app.route("/sendMail", methods=['POST'])
def sendMail():
data = request.get_json()
print(data)
from_email = data.get('from email')
to_email = data.get('to email')
subject = data.get('subject')
contents = data.get('contents')
sender = from_email
receiver = to_email
msg = '''\
... From: [email protected]
... Subject: testin'...
...
... This is a test '''
smtpObj = smtplib.SMTP('mail.kfems.org', 25)
smtpObj.sendmail(sender, receiver, msg)
return jsonify(data)
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=5050)
The text was updated successfully, but these errors were encountered:
Hello I am simply trying to send mail using smtplib.
I added the certificate to the smtp container, and when I ran that code, this '550, b'relay not permitted' occurred. It seems that it cannot be received from other receiving servers.
Please help.
Thank you.
The text was updated successfully, but these errors were encountered: