//these are the pakages to be imported from
// Java Mail
//The Java Mail PAckage either be dowloaded
//seperately
//or else is Available in the " /> 麻豆社区,人人爽人人爽人人片c,xxxxxx日本人免费

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

JSP發(fā)送郵件實(shí)例

vishal_donth gave this response on 10/18/2000:  
//these are the pakages to be imported from  
// Java Mail  
//The Java Mail PAckage either be dowloaded  
//seperately  
//or else is Available in the J2sdkee1.2  
// (Java Enterprise Edition)  

import Javax.mail.*;  
import Javax.mail.interNET.*;  
import Java.util.*;  


//This function can be used to send the mail  
// with the parameters given to it  
//U have to specify the smtp server through  
//which u have to send the mail  
//since i was trying with a homeNETmail  
//account i directly sent the mail its server  
//For sending this mail u need a mail server  
//which lets u to relay the messages  
//Try this thing for sending to a  
//www.homeNETmail.com account because it lets  
//u send  
//mails to the accounts like example try  
//sending it to a "abc@homeNETmail.com"  
//account.Create the mail account in homeNET  
//mail first. If u get any other server which  
//supports relaying u can try this on that  
//also.  

//Use this function in ur Servlet to send  
//mail by calling the function with the  
//parameters  

public void sendMail(String toAddr, String subject, String body, String fromAddr)throws RemoteException{  
try{  
Properties props = new Properties();  
props.put("mail.smtp.host","mail.homeNETmail.com");  
//Here we specify the SMTP server through  
//which the mail should be delivered  
Session session = Session.getDefaultInstance(props, null);  
Message msg = new MimeMessage(session);  
msg.setFrom(new InterNETAddress(fromAddr));  
//Specify the From Address  
InterNETAddress[] tos =InterNETAddress.parse(toAddr);  
//Specify the To Address  
msg.setRecipients(Message.RecipientType.TO,tos);  
msg.setSubject(subject);  
//Specify the Subject  
msg.setText(body);  
//Specify the Body  
Transport.send(msg);  
System.out.println("Message is Sent");  
}  
catch(Exception e){  
System.out.println(e);  
}  
}  

// U have to run this function on a computer  
//which is directly connected  
// to interNET but not through a  
//proxy......or else use a proxy which  
//supports SMTP  

jsp技術(shù)JSP發(fā)送郵件實(shí)例,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 涩涩涩涩| 91精品免费观看 | 韩国在线观看一区二区三区 | 亚洲一区2区三区4区5区 | 98bb国产精品视频 | 影院亚洲| 日本网络视频www色高清免费 | 国产永久在线视频 | 成年人福利视频 | 中文字幕日本一本二本三区 | 国产青草视频在线观看 | 免费人成综合在线视频 | 欧美一级高清片免费一级 | 精品国精品国产自在久国产不卡 | 国产99视频精品免费视频7 | 国产精品原创视频 | 色哒哒影院 | 大色虫成人午夜在线观看 | 欧美亚洲国产成人精品 | 国产精品视频观看 | 国内高清自拍 | 97国产精品人人爽人人做 | 色婷婷综合欧美成人 | 5566成人免费视频观看 | 美女扒开内衣看个够网站 | 99国产精品国产精品 | 日韩午夜在线观看 | 91福利网站 | 中文在线1区二区六区 | 欧美人体一区二区三区 | 精品久久亚洲一级α | 日本巨黄视频 | 欧美精品亚洲精品日韩专区 | 国产综合在线观看视频 | 色交视频 | 国产精品美女网站在线看 | 91大神麻豆 | 精品视频免费看 | 国产视频精品久久 | 色午夜在线 | 久久亚洲精品成人综合 |