from flask.ext.wtf import Form
from wtforms import TextField, SubmitField
from wtforms.validators import InputRequired, Email
from wtforms.fields.html5 import EmailField


class ContactForm(Form):
    name = TextField('Name', validators=[InputRequired(
        'Please enter your name.')])
email = EmailField('Email', validators=[InputRequired(
    'Please enter your email address.'), Email(
    'Please enter your email address.')])
submit = SubmitField('Send')
Email Validation from WTForm using Flask