次のコードを使用して、事前定義されたフィールドで電子メール クライアントを起動しています。ローカル マシンでテストすると、電子メール クライアントは期待どおりに起動しますが、運用サーバーでは起動しません。本番サーバーでは、「/」へのリダイレクトを取得するだけです。電子メール クライアントが起動する原因について何か提案はありますか? すべてのブラウザでテストしましたが、動作に違いは見られませんでした。
@app.route('/errorform', methods=['GET', 'POST'])
def errorform():
form = ErrorForm()
logs = str(open(file, "r").readlines()[int(file_len(file))]).rstrip()
if form.validate_on_submit():
if form.includeLogs.data == False:
webbrowser.open('mailto:test@mail.com?subject=Feedback&body=<insert your message here>')
return redirect('/')
else:
webbrowser.open('mailto:test@mail.com?subject=Feedback&body=<insert your message here> \n\n Logs: %s' % (logs))
return redirect('/')
return render_template('main.html', form=form, show_results=0, page = 'errorform')