I am developing my own portfolio and about website and in contact form i want mail sender using flask but i am getting this error( can only concatenate list (not "str") to list).
I want that if anyone wanna send me message then i will get email.But i am facing the error.Need help.
@app.route("/contact",methods = ['GET', 'POST'])
def contact():
if(request.method=='POST'):
name = request.form.get('name')
email = request.form.get('email')
message = request.form.get('message')
msg = Message('Hello', sender = email, recipients = "[email protected]")
msg.body = message
mail.send(msg)
return render_template('contact.html')
The
recipientsargument expects a list which is why you get the error. Use this instead: