【问题标题】:Hyperlinking text in django which sends to an email [duplicate]django中的超链接文本发送到电子邮件[重复]
【发布时间】:2013-07-29 16:29:19
【问题描述】:

我想将“点击此处”设为一个超链接,当点击该链接时,例如会将人们发送到 127.0.0.1。

 confirm_links = 'To confirm this order <a href= "127.0.0.1://confirmorder/" > click here </a> '

我认为这通常可以工作,但我通过电子邮件发送代码。

【问题讨论】:

  • 检查上面的链接 - 基本上,你可以按照你想要的方式设计模板..

标签: python html django email


【解决方案1】:
from django.core.mail import send_mail

send_mail('Subject here', 'Here is the message.', 'from@example.com',
    ['to@example.com'], fail_silently=False)

你想要这样的东西吗?

<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">

【讨论】:

  • 我已经实现了这段代码。它已经向用户发送了一封电子邮件。我试图弄清楚如何在通过电子邮件发送文本时将其激活为超链接。
  • 错误。我希望让文本的正文成为超链接。不是标题
猜你喜欢
  • 1970-01-01
  • 2016-01-08
  • 2014-03-10
  • 2013-08-22
  • 2013-08-25
  • 2015-06-10
  • 1970-01-01
  • 2018-05-20
  • 1970-01-01
相关资源
最近更新 更多