|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
用winrar打包j2ee的程序和用IDE打包应用程序是一样的。按照你的想法,你是不是也希望服务器都整合由一家公司提供呢?smtpPropertiesprops=System.getProperties();
props.put("mail.smtp.host",host);
StringmailNeedAuth=CatseyeConfig.getConfig("MailNeedAuth");
StringmailUser=CatseyeConfig.getConfig("MailUser");
StringmailPassword=CatseyeConfig.getConfig("MailPassword");
if(mailNeedAuth.equals("1")){
props.put("mail.smtp.auth","true");
}else{
props.put("mail.smtp.auth","false");
}
Sessionsession=Session.getDefaultInstance(props,null);
javax.mail.Messagemsg=newMimeMessage(session);
InternetAddress[]toAddrs=null;
try{
if(recipients!=null){
toAddrs=InternetAddress.parse(recipients,false);
msg.setRecipients(javax.mail.Message.RecipientType.TO,toAddrs);
}else{
thrownewException("Norecipientaddressspecified");
}
if(sender!=null){
msg.setFrom(newInternetAddress(sender));
}else{
thrownewException("Nosenderaddressspecified");
}
if(subject!=null){
msg.setSubject(subject);
}
/*
BodyPartbp=newMimeBodyPart();
bp.setContent(body,"text/html");
Multipartmp=newMimeMultipart();
mp.addBodyPart(bp);
*/
//msg.setContent(mp);
msg.setContent(body,"text/html");
msg.setHeader("X-Mailer","CatseyeSMTPRobot");
msg.setHeader("Content-Type","text/html");
/*
msg.setDataHandler(newDataHandler(
newByteArrayDataSource(body,"text/html")));
//msg.setText(body);
*/
Transporttrans=session.getTransport("smtp");
trans.connect(host,mailUser,mailPassword);
trans.sendMessage(msg,
msg.getRecipients(
javax.mail.Message.RecipientType.TO));
市场分额,java比asp高一点,因为C#是仿照java开发的,所以哦C#能做的java都能做到,但是java能做的,C#不一定都能做到。毕竟是抄袭吗。 |
|