Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jabismonte opened this issue Sep 13, 2018 · 4 comments

Comments

@jabismonte
Copy link

jabismonte commented Sep 13, 2018

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

@lavr
Copy link
Owner

lavr commented Sep 13, 2018

Can you show some code to reproduce this?

@jabismonte
Copy link
Author

jabismonte commented Sep 14, 2018

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
Copy link
Author

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

@lavr
Copy link
Owner

lavr commented Sep 15, 2018

Well, there is too much conditions to reproduce something.

May be you can show your traceback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants