flask-emails icon indicating copy to clipboard operation
flask-emails copied to clipboard

Getting "message": "'>' not supported between instances of 'str' and 'int'" error.

Open jabismonte opened this issue 6 years ago • 4 comments

Hi, I followed how you've sent email with your test cases but yet I received this error.

jabismonte avatar Sep 13 '18 18:09 jabismonte

Can you show some code to reproduce this?

lavr avatar Sep 13 '18 22:09 lavr

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)

jabismonte avatar Sep 14 '18 11:09 jabismonte

it happens when i call the Message() class in the send_mail method

jabismonte avatar Sep 14 '18 12:09 jabismonte

Well, there is too much conditions to reproduce something.

May be you can show your traceback?

lavr avatar Sep 15 '18 12:09 lavr