SHARE
TWEET

Untitled

a guest Jul 17th, 2017 63 in 3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from flask import Flask
  2. from flask_mail import Mail
  3. from flask_mail import Message
  4.  
  5. app = Flask(__name__)
  6. mail = Mail(app)
  7.  
  8.  
  9. MAIL_SERVER = "mail.gerasoft.com.br"
  10. MAIL_PORT = 26
  11. MAIL_USE_TLS = False
  12. MAIL_USE_SSL = False
  13. MAIL_USERNAME = "suporte@gerasoft.com.br"
  14. MAIL_PASSWORD = "gera99"
  15. MAIL_DEFAULT_SENDER = "suporte@gerasoft.com.br"
  16.  
  17.  
  18. msg = Message(form.data['assunto'], recipients=['suporte@gerasoft.com.br'])
  19. msg.body = (
  20.     'Empresa: {empresa}\n'
  21.     'Email: {email}\n'
  22.     'Nome: {nome}\n'
  23.     'Telefone: {telefone}\n\n'
  24.     '{mensagem}'    
  25.     ).format(**form.data)
  26.  
  27. mail.send(msg)
RAW Paste Data
Top