I'm trying to access a request from an HTML form, and send it as a mail, but I get a mail with a value of "None",
我正在尝试从HTML表单访问请求,并将其作为邮件发送,但我收到的邮件的值为“无”,
here is my code:
这是我的代码:
@app.route("/about", methods=['GET', 'POST'])
def send_message():
name = request.form.get('name')
msg = Message(
subject='Hello ' + str(name),
sender='kristofferlocktolboll@gmail.com',
recipients=
['kristofferlocktolboll@gmail.com'],
html=render_template("about.html"))
mail.send(msg)
confirm_msg = "Your message has been sent!"
return render_template("about.html", confirm_msg=confirm_msg)
I think it might be due to the fact, that I'm casting the object into a string, but if I don't do that, I will get an error due to making a conjunction between a String and another object
This article explores the process of integrating Promises into Ext Ajax calls for a more functional programming approach, along with detailed steps on testing these asynchronous operations. ...
[详细]