#!/usr/bin/env python

from flask import Flask, request
from flask_mail import Mail, Message

mail = Mail()

app = Flask(__name__)
mail.init_app(app)

# app.config.update(
#     MAIL_SERVER='TO_COMPLETE',
#     MAIL_PORT='TO_COMPLETE',
#     MAIL_USE_TLS=True,
#     MAIL_USERNAME='TO_COMPLETE',
#     MAIL_PASSWORD='TO_COMPLETE'
# )

@app.route('/test')
def test():
    return "It works"

@app.route('/contact', methods=['POST'])
def contact():

    msg = Message("Message Codincamp",
                  sender=request.form['from'],
                  recipients=[request.form['to']])
    msg.html = msg.body = request.form['body']
    mail.send(msg)

    return "EMAIL SENT"

if __name__ == '__main__':
    app.run(host= '0.0.0.0', debug=True)

@@ -439,24 +439,26 @@
 tact():%0A%0A   
+ #
  msg = Messa
@@ -480,24 +480,26 @@
 incamp%22,%0A   
+ #
             
@@ -530,24 +530,25 @@
 from'%5D,%0A    
+#
             
@@ -549,16 +549,17 @@
         
+ 
 recipien
@@ -586,16 +586,18 @@
 '%5D%5D)%0A   
+ #
  msg.htm
@@ -635,16 +635,18 @@
 dy'%5D%0A   
+ #
  mail.se
@@ -653,17 +653,16 @@
 nd(msg)%0A
-%0A
     retu
@@ -669,19 +669,131 @@
 rn %22
-EMAIL SENT%22
+%25s va recevoir le message suivant de la part de %25s : %25s%22 %25 (request.form%5B'to'%5D, request.form%5B%22from%22%5D, request.form%5B'body'%5D)
 %0A%0Aif

Debug message