Mailto链接到Python-Telegram-Bot消息,用于让用户发送预编译电子邮件
是否有一种简单的方法可以显示一个超链接,以让用户在Python-Telegram-bot中发送电子邮件?我已经尝试过,但是链接将用户重定向到电子邮件域的网页。我将重定向到默认邮件应用程序。
context.bot.sendMessage(chat_id=update.message.chat_id, text="Contact us <a href='mailto:[email protected][email protected]&subject=Support%20request%20&body=Write%20here%20your%20issue:'>here</a> to solve the problem together.", parse_mode="HTML")
感谢您的帮助 ;)
is there a simple way to show a hyperlink for letting user send an email in python-telegram-bot? I've tried this but the link redirects the user to a web page of the email domain. I would have a redirect into a default mail app.
context.bot.sendMessage(chat_id=update.message.chat_id, text="Contact us <a href='mailto:[email protected][email protected]&subject=Support%20request%20&body=Write%20here%20your%20issue:'>here</a> to solve the problem together.", parse_mode="HTML")
Thank you for your help ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是电报无法识别
mailto:
url。为了将其包装到“可接受的”https
url中,您可以使用Tinyurl等URL缩短服务。这样,https
url将重定向到mailto
url,这就是您想要的。这是一个例子:
The problem is that Telegram doesn't recognize
mailto:
urls. In order to wrap it into an "acceptable"https
url, you can use the URL shortening services like TinyUrl. This way, thehttps
url will redirect into amailto
url which is what you want.Here's an example: