【问题标题】:how to send link in emal using java mail sender如何使用java邮件发件人在电子邮件中发送链接
【发布时间】:2016-08-24 04:31:40
【问题描述】:

嗨,我正在尝试使用 gmail smtp 在电子邮件中发送链接。但它以字符串形式发送。任何人都可以帮助我。提前致谢。 爪哇:

 String url="localhost:8080/#/activateuser/5575/958104f7-557e-4703-bcf7-55c9e37b7ad7";
        String content="<a href='"+url+"'>"+url+"</a>";
        msg.setContent(message1+" "+content,"text/html; charset=utf-8");

        // sends the e-mail
        Transport.send(msg);
        logger.info("Email sent succesfully");

回应: 验证令牌:5575 要设置密码,请单击此网址:localhost:8080/#/activateuser/5575/958104f7-557e-4703-bcf7-55c9e37b7ad7(我想将此网址显示为链接)

【问题讨论】:

  • 您可能需要在“localhost:8080”之前添加“http://”
  • 非常感谢@sumit badaya。它工作正常

标签: java html-email


【解决方案1】:

您可能需要在“localhost:8080”之前添加“http://”

【讨论】:

    猜你喜欢
    • 2015-10-09
    • 1970-01-01
    • 1970-01-01
    • 2013-10-27
    • 2020-09-25
    • 2014-12-15
    • 1970-01-01
    • 2016-01-21
    • 1970-01-01
    相关资源
    最近更新 更多