import java.util.*;

import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

public class SimpleSendMessage {

public static void main(String[] args) { " /> 欧美日韩成人在线观看,97热久久免费频精品99国产成人,老湿影院福利社

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

郵件發送簡單例子-bean文件

SimpleSendMessage.Java

import Java.util.*;

import Javax.mail.*;
import Javax.mail.interNET.*;
import Javax.activation.*;

public class SimpleSendMessage {

public static void main(String[] args) {

// Collect the necessary information to send a simple message
// Make sure to replace the values for host, to, and from with
// valid information.
// host - must be a valid smtp server that you currently have
// access to.
// to - whoever is going to get your email
// from - whoever you want to be. Just remember that many smtp
// servers will validate the domain of the from address
// before allowing the mail to be sent.
String host = "server.myhost.com";
String to = "YourFriend@somewhere.com";
String from = "MeMeMe@myhost.com";
String subject = "JSP Rules!";
String messageText = "I am sending a message using the"
+ " JavaMail API./nI can include any text that I want.";
boolean sessionDebug = false;

// Create some properties and get the default Session.
Properties props = System.getProperties();
props.put("mail.host", host);
props.put("mail.transport.protocol", "smtp");

Session session = Session.getDefaultInstance(props, null);

// Set debug on the Session so we can see what is going on
// Passing false will not echo debug info, and passing true
// will.
session.setDebug(sessionDebug);

try {

// Instantiate a new MimeMessage and fill it with the
// required information.
Message msg = new MimeMessage(session);

msg.setFrom(new InterNETAddress(from));
InterNETAddress[] address = {new InterNETAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setText(messageText);

// Hand the message to the default transport service
// for delivery.
Transport.send(msg);
}
catch (MessagingException mex) {

mex.printStackTrace();
}
}
}

jsp技術郵件發送簡單例子-bean文件,轉載需保留來源!

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

主站蜘蛛池模板: 99超级碰碰成人香蕉网 | 亚洲二区在线播放 | 伊人狼人综合 | 玖玖国产 | 国产在线观看中文字幕 | 国产亚洲高清在线精品99 | 成人精品第一区二区三区 | 国产精品女同一区二区久久夜 | 快播黄色 | 免费午夜视频 | 亚洲欧美视频网站 | 伊人青青草 | 三级午夜宅宅伦不卡在线 | 欧美日韩一二三四区 | 国内精品日本久久久久影院 | 国产百合一区二区三区 | www.麻豆91| 亚洲图片第一页 | 激情网站网址 | 国产夫妻小视频 | 国产系列 视频二区 | 国产一区二区色淫影院 | 久久精品99无色码中文字幕 | 李雅在线观看一区国产 | 亚洲天堂久久精品 | 一区二区亚洲视频 | 国产精品激情综合久久 | 国产成人精品一区二区三在线观看 | 麻豆精品91 | 精品网址 | 黄色小视频网 | 狠狠入ady亚洲精品 狠狠色成人综合首页 | 久久99草 | 亚洲精品国自产拍影院 | 成人看的午夜免费毛片 | 久久久久久亚洲精品中文字幕 | 大尺度福利视频 | 久久99国产亚洲高清 | 色综合天 | 2019偷偷狠狠的日日 | 国产精品亚洲综合色拍 |