//these are the pakages to be imported from
// Java Mail
//The Java Mail PAckage either be dowloaded
//seperately
//or else is Available in the " /> 四虎国产精品高清在线观看,美女18黄,久久精品国产亚洲AV蜜臀

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

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 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技術JSP發送郵件實例,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 免费人妻无码AV不卡在线 | 日日啪无需播放器 | 精品AV国产一区二区三区 | 成人在无码AV在线观看一 | 青青精品国产自在线拍 | 精品无码久久久久久久动漫 | 亚洲精品免费在线视频 | 精品亚洲视频在线观看 | 精品亚洲一区二区三区在线播放 | 一二三四在线播放免费观看中文版视频 | 国产成人免费高清激情视频 | 一个人HD高清在线观看免费视频 | 制服国产欧美亚洲日韩 | 亚洲乱码爆乳精品成人毛片 | 99久久亚洲精品日本无码 | 国产精品成久久久久三级四虎 | 日本国产黄色片 | 中国农民真实bbwbbw | 一道精品视频一区二区 | 久久热最新网站获取3 | 精品一区二区三区高清免费观看 | 国产精品免费视频能看 | 欧洲最大无人区免费高清完整版 | 亚洲精品久久YY5099 | 欧美美女一区二区三区 | 亚洲精品日韩在线观看视频 | 久久国产主播福利在线 | 五月丁香婷姐色 | 亚洲中文字幕无码一久久区 | 97人妻久久久精品系列A片 | 全黄h全肉细节全文 | 丰满的女朋友韩国版在线观看 | 快播看黄片 | 国语自产视频在线不卡 | 色欲色香天天天综合 | 欧美白人极品性喷潮 | 国产精品av | 97人人碰免费视频公开 | 国产成久久免费精品AV片天堂 | 欧美日韩在线成人看片a | 成年视频xxxxxx在线 |