//these are the pakages to be imported from
// Java Mail
//The Java Mail PAckage either be dowloaded
//seperately
//or else is Available in the " /> 五月婷婷精品,欧美日韩一区二区三区四区,最近2019中文字幕大全视频1

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

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

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

主站蜘蛛池模板: 久久国产99| 免费黄色美女网站 | 国产精品一区二 | www狠狠干 | 免费观看欧美一级特黄 | 国产精品成人观看视频网站 | 成年网站视频在线观看 | 久久精品影院永久网址 | 91精品啪在线观看国产日本 | 91香蕉国产亚洲一二三区 | 日本高清一区二区三区不卡免费 | 韩国毛片免费 | 成年美女黄网站色大片视频 | 丰满美女毛片 | 成人午夜视频在线观 | 国内高清自拍 | 狠狠综合欧美综合欧美色 | 久久免费精品视频 | 美国毛片亚洲社区在线观看 | 欧美人体大胆私密视频 | 多人伦精品一区二区三区视频 | 激情15p | 中文字幕精品视频在线 | 色四月婷婷 | 黑猫福利精品第一视频 | 亚洲区色| 九月婷婷综合 | 国产一区二区高清 | 久久终合| 99精品视频在线视频免费观看 | 欧美人人做人人爽人人喊 | 久久国产一区二区三区 | 思思玖玖玖在线精品视频 | 色中文字幕在线 | 午夜欧美性欧美 | 色视频在线观看在线播放 | 国产亚洲精品午夜高清影院 | 亚洲一区二区三区免费 | 丁香四月婷婷 | 欧洲成人r片在线观看 | 5月丁香6月婷婷 |