Vikings

          重溫javaMail


          1。服務系統不需要驗證發件人的授權的
          ????Session?session?=?Session.getDefaultInstance(props,?null);?
          2。要驗證發件人的授權
          ????props.put("mail.smtp.auth",?"true");?
          ????MyAuthenticator?myauth?=?new?MyAuthenticator("你自己的電子信箱",?"你自己的信箱密碼");
          ????Session?session?=?Session.getDefaultInstance(props,?myauth);
          3。同時發送多封電子郵件
          Transport.send(message);可以使用下面的代碼來代替
          ??????String?username?=?"你的電子信箱用戶名";
          ??????String?password?=?"你的電子信箱密碼";
          ??????message.saveChanges();?//????implicit?with?send()
          ??????Transport?transport?=?session.getTransport("smtp");
          ??????transport.connect("mail.htf.com.cn",?username,?password);
          ??????transport.sendMessage(message,?message.getAllRecipients());
          ??????transport.close();

          Communication Component,溫習。
          http://www.china1024.com/news_content.jsp?news_id=1060

          posted on 2006-11-28 11:33 Vikings 閱讀(178) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 介休市| 嘉黎县| 高碑店市| 会同县| 北川| 四子王旗| 长宁县| 元谋县| 望谟县| 乃东县| 宜川县| 聂荣县| 忻城县| 南澳县| 广德县| 蛟河市| 林芝县| 南昌市| 台北市| 麻江县| 无锡市| 玉溪市| 宁安市| 中宁县| 宁都县| 三台县| 东乡| 湖州市| 自治县| 江城| 沁源县| 宣威市| 来宾市| 九龙城区| 应用必备| 太原市| 陇南市| 东乌| 荥经县| 永兴县| 吴川市|