无法使用 Python 在电子邮件上发送超链接
我将链接粘贴到电子邮件的内容消息中,但该链接没有出现在发送的电子邮件中。
try:
content = "https://www.google.com/"
mail = smtplib.SMTP('smtp.gmail.com', 587)
mail.ehlo()
mail.starttls()
mail.login('my_emailgmail.com','password')
mail.sendmail('my_email.gmail.com', "receiver.gmail.com", content)
mail.quit()
print("Successfully sent email")
except:
print("Nah")
I paste the link in the content message of my email but the link doesn't appear in the email sent.
try:
content = "https://www.google.com/"
mail = smtplib.SMTP('smtp.gmail.com', 587)
mail.ehlo()
mail.starttls()
mail.login('my_emailgmail.com','password')
mail.sendmail('my_email.gmail.com', "receiver.gmail.com", content)
mail.quit()
print("Successfully sent email")
except:
print("Nah")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用其他方法解决了这个问题。这是修改后的代码:
I solved the problem using an other method. Here is the code modified: