flask-emails
flask-emails copied to clipboard
Getting "message": "'>' not supported between instances of 'str' and 'int'" error.
Hi, I followed how you've sent email with your test cases but yet I received this error.
Can you show some code to reproduce this?
This is defined in email.py
from flask_emails import Message, EmailsConfig
def send_mail():
SAMPLE_MESSAGE = {
'html': '<p>Test from flask_emails',
'mail_from': '[email protected]',
'mail_to': '[email protected]',
'subject': 'Test from flask_emails'
}
message = Message(SAMPLE_MESSAGE)
r = message.send()
then I have a mutation located in this file send_email.py.
import graphene
from email import send_email
class SendEmailMutation(graphene.Mutation):
success = graphene.Boolean()
def mutate(self, info):
try:
send_mail()
return SendEmailMutation(success=True)
except Exception as e:
return e
.env file used by flask app
EMAIL_HOST="localhost"
EMAIL_PORT=25
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_TIMEOUT=30
EMAIL_SMTP_DEBUG=0
main.py
app = Flask(__name__)
env = DotEnv(app)
it happens when i call the Message() class in the send_mail method
Well, there is too much conditions to reproduce something.
May be you can show your traceback?