第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在每天的特定時(shí)間使用java發(fā)送郵件

如何在每天的特定時(shí)間使用java發(fā)送郵件

達(dá)令說 2019-04-18 18:15:45
我工作的一個(gè)web_application唱Java,servlets,JSP以及使用Apache Tomcat作為應(yīng)用服務(wù)器我做了什么我創(chuàng)建了一個(gè)UI用戶選擇郵件ID的地方(他們可以選擇多個(gè))當(dāng)用戶點(diǎn)擊發(fā)送按鈕時(shí),我正在觸發(fā)我的java類并發(fā)送郵件現(xiàn)在我要做什么現(xiàn)在我必須動(dòng)態(tài)地執(zhí)行此操作,每晚12點(diǎn)鐘我必須向某些特定用戶發(fā)送郵件我必須向其發(fā)送郵件的用戶我從登錄查詢中獲取該郵件ID,這不是問題我只是想知道如何在午夜時(shí)分12:00發(fā)送郵件Codding我到現(xiàn)在為止做過servlet類public class EmailSendingServlet extends HttpServlet {private static final long serialVersionUID = 1L;private String host;private  String port;private String user;private String pass;public void init() {     ServletContext context = getServletContext();     host = context.getInitParameter("host");     port = context.getInitParameter("port");     user = context.getInitParameter("user");     pass = context.getInitParameter("pass");}protected void doPost(HttpServletRequest request,         HttpServletResponse response) throws ServletException, IOException {     String recipient = request.getParameter("To"); // this i will get from login query     String subject = request.getParameter("subject");//this i can define manually     String content = request.getParameter("content");//same for this also     String resultMessage = "";     try {         EmailUtility.sendEmail(host, port, user, pass, recipient, subject,                 content);         resultMessage = "The e-mail was sent successfully";     } catch (Exception ex) {         ex.printStackTrace();         resultMessage = "There were an error: " + ex.getMessage();     } }}
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 815 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)