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)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 大安市| 故城县| 前郭尔| 康平县| 阜康市| 隆林| 青河县| 宁陕县| 湖北省| 同仁县| 呈贡县| 利川市| 射阳县| 玉环县| 太谷县| 色达县| 郧西县| 收藏| 义马市| 乌鲁木齐市| 汉中市| 酒泉市| 缙云县| 广东省| 贵德县| 韩城市| 张北县| 辉南县| 怀化市| 祁东县| 太康县| 揭东县| 周口市| 长岛县| 禹城市| 正阳县| 大名县| 甘肃省| 宿松县| 克什克腾旗| 巴彦县|