六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

JSP發送郵件案例

[摘要]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 dowloade...
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 "[email protected]"  
//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  



主站蜘蛛池模板: 亚州激情视频在线播放 | 天天干妹子 | 午夜精品视频5000 | 丝袜美腿美女被狂躁在线观看 | 青青青免费高清视频在线 | 青春草a∨在线观看免费app | 在线观看欧美日韩 | 日本视频免费在线观看 | 四虎在线免费播放 | 五月天激情婷婷大综合 | 欧美亚洲第一区 | 在线视免费频观看韩国aaa | 在线v| 伊人久久中文 | 亚洲国产成人va在线观看网址 | 日本免费高清视频二区 | 亚洲性久久久影院 | 中文学幕专区 | 午夜亚洲国产成人不卡在线 | 日韩视频在线播放 | 日本最新中文字幕 | 欧美怡春院一区二区三区 | 天天操天天插天天射 | 天堂伦理| 日韩在线免费看网站 | 在线播放国产一区二区三区 | 丝袜美腿中文字幕 | 欧美一区二区三 | 四虎中文 | 欧美亚洲欧美日韩中文二区 | 午夜久久久久久网站 | 亚洲精品中文字幕乱码三区一二 | 亚洲精品123区 | 四虎永久在线 | 青青视频在线播放 | 亚洲伦理在线观看 | 欧美婷婷综合 | 日韩一区二区不卡 | 最近韩国日本免费观看 | 热久久伊人 | 青青青爽线在线视频观看 |