如何使用java邮件发件人在emal中发送链接

nar*_*nda 2 java html-email

您好我想尝试使用gmail smtp发送电子邮件中的链接.但它发送为String.can任何身体帮助我.提前致谢.Java的:

 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");
Run Code Online (Sandbox Code Playgroud)

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

Sum*_*aya 6

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