HTML按钮未重定向到Java邮件正文中的给定链接
我想在我正在创建的HTML电子邮件模板中添加一个按钮。 我已经创建了一个按钮,但是当我点击它时,链接没有出现。 有人能帮我解决我的问题吗 这是我的密码:HTML按钮未重定向到Java邮件正文中的给定链接,java,html,button,onclick,Java,Html,Button,Onclick,我想在我正在创建的HTML电子邮件模板中添加一个按钮。 我已经创建了一个按钮,但是当我点击它时,链接没有出现。 有人能帮我解决我的问题吗 这是我的密码: messageBodyPart.setContent("<h1>You Have a Promotion</h1> <h3>Your First Name :</h3>" + FirstNm + "<h3>Your Last Name :&
messageBodyPart.setContent("<h1>You Have a Promotion</h1> <h3>Your First Name :</h3>" + FirstNm +
"<h3>Your Last Name :</h3>" + LastNm + "<h3>Your Employee ID :</h3>" + Employeeid +
" <br/> <form>\r\n" +
"<input class=\"MyButton\" onclick =\"http://localhost:8080/update/status/password/ACCEPT\" type = \"button\" value =\"Accept Your Promotion\" />\r\n" +
"</form>","text/html");
messageBodyPart.setContent(“您的名字:+FirstNm+
您的姓氏:“+LastNm+”您的员工ID:“+Employeeid+
“
\r\n”+
“\r\n”+
“”和“text/html”);
您可以使用如下输入:
尝试添加锚定标记,并使用
href
属性,而不是input
元素上的onclick
事件
messageBodyPart.setContent("<h1>You Have a Promotion</h1> <h3>Your First Name :</h3>" + FirstNm +
"<h3>Your Last Name :</h3>" + LastNm + "<h3>Your Employee ID :</h3>" + Employeeid +
" <br/> <form>\r\n" +
"<a href=\"http://localhost:8080/update/status/password/ACCEPT\"><input class=\"MyButton\" type = \"button\" value =\"Accept Your Promotion\" /></a>\r\n" +
"</form>","text/html");
messageBodyPart.setContent(“您的名字:+FirstNm+
您的姓氏:“+LastNm+”您的员工ID:“+Employeeid+
“
\r\n”+
“\r\n”+
“”和“text/html”);
是否要删除标签?是。。。你可以松开它。你知道我可以在引导中添加一些样式到邮件正文中吗