我想在我創(chuàng)建的 HTML 電子郵件模板中添加一個按鈕。我已經(jīng)創(chuàng)建了一個按鈕,但是當(dāng)我點擊它時,鏈接沒有出現(xiàn)。任何人都可以幫助我解決我的問題嗎?這是我的代碼: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");
2 回答

慕姐8265434
TA貢獻(xiàn)1813條經(jīng)驗 獲得超2個贊
嘗試在元素上添加錨標(biāo)記和href屬性而不是onclick事件input。
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");
添加回答
舉報
0/150
提交
取消