|
|
|
@ -1,23 +1,10 @@ |
|
|
|
from flask import ( |
|
|
|
Flask, |
|
|
|
Blueprint, |
|
|
|
render_template |
|
|
|
) |
|
|
|
|
|
|
|
from flask_mail import Mail, Message |
|
|
|
|
|
|
|
bp = Blueprint("paginas", __name__) |
|
|
|
|
|
|
|
|
|
|
|
app = Flask(__name__) |
|
|
|
app.config['MAIL_SERVER']= 'smtp.mail.yahoo.com' |
|
|
|
app.config['MAIL_PORT'] = 465 |
|
|
|
app.config['MAIL_USERNAME'] = 'celestino_rey@ymail.com' |
|
|
|
app.config['MAIL_PASSWORD'] = 'kbryvwxkockqckss' |
|
|
|
app.config['MAIL_USE_TLS'] = False |
|
|
|
app.config['MAIL_USE_SSL'] = True |
|
|
|
mail = Mail(app) |
|
|
|
|
|
|
|
@bp.route("/") |
|
|
|
def inicio(): |
|
|
|
return render_template("autorizacion/index.html") |
|
|
|
@ -25,14 +12,3 @@ def inicio(): |
|
|
|
@bp.route("/acerca") |
|
|
|
def acerca(): |
|
|
|
return render_template("paginas/acerca.html") |
|
|
|
|
|
|
|
|
|
|
|
@bp.route("/envia_mail") |
|
|
|
def envia_mail(): |
|
|
|
msg = Message('Hola desde el otro lado!', sender='celestino_rey@ymail.com', recipients=['king.bernard.b@gmail.com']) |
|
|
|
msg.body = "Hola, companero, te envio este correo para ver si funciona." |
|
|
|
mail.send(msg) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "Mensaje enviado" |