当前位置: 技术问答>java相关
请问有没有完整的javamail的例子?有的话请告诉小弟,小弟急着用。高分送
来源: 互联网 发布时间:2015-07-21
本文导语: 请问有没有完整的javamail的例子?有的话请告诉小弟,小弟急着用。高分送 | 给你一个经调试通过的收邮件的程序: =0;i--){ InternetAddress[] from = (InternetAddress[])messages[i].getFr...
请问有没有完整的javamail的例子?有的话请告诉小弟,小弟急着用。高分送
|
给你一个经调试通过的收邮件的程序:
=0;i--){
InternetAddress[] from = (InternetAddress[])messages[i].getFrom();
InternetAddress[] to = (InternetAddress[])messages[i].
getRecipients(Message.RecipientType.TO);
%>
=0;i--){
InternetAddress[] from = (InternetAddress[])messages[i].getFrom();
InternetAddress[] to = (InternetAddress[])messages[i].
getRecipients(Message.RecipientType.TO);
%>
To , from ,
subject ,date:,body:
|
服务器要求验证啊!需要重写 Authenticator类
ublic class mymail extends Authenticator {
String userName,password;
public mymail(String user,String pass) {
super();
userName=new String(user);
password=new String(pass);
}
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(userName,password);
}
try it!
ublic class mymail extends Authenticator {
String userName,password;
public mymail(String user,String pass) {
super();
userName=new String(user);
password=new String(pass);
}
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication(userName,password);
}
try it!
|
mail.html
To:
From:
Subject:
Sample JSP email Utility Using JavaMail
sendmail.jsp
JSP meets JavaMail, what a sweet combo.
To:
From:
Subject:
Message:
Sample JSP email Utility Using JavaMail
sendmail.jsp
JSP meets JavaMail, what a sweet combo.
Your mail has been sent.