Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/398.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML按钮未重定向到Java邮件正文中的给定链接_Java_Html_Button_Onclick - Fatal编程技术网

HTML按钮未重定向到Java邮件正文中的给定链接

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 :&

我想在我正在创建的HTML电子邮件模板中添加一个按钮。 我已经创建了一个按钮,但是当我点击它时,链接没有出现。 有人能帮我解决我的问题吗

这是我的密码:

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”);
是否要删除标签?是。。。你可以松开它。你知道我可以在引导中添加一些样式到邮件正文中吗