分类:
2008-09-11 14:31:47
如果你认为没有必要设置MAIL,而又要用JAVAMAIL的邮件发送功能,那最好的方式就是用自己的免费邮箱!可这些服务器登陆必须要进行验证,所以需要进行带有身份验证的JAVAMAIL编程!
说明:
1.javamail.jar和JAF框架(处理多种格式)
2.用你现有的免费邮箱的邮件服务器(需要身份认证)
3.SendEcard.java 发送mail(带附件)的javabean 4.Email_ca.java
身份认证的javabean package netcard; /** *SendEcard.java *发送mail的javabean */ import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendEcard {
private String tomail;
private String frommail;
private String subject;
private String content;
private String imagecard;
String smtp="****";//设置邮件服务器
public SendEcard()
{
}
public String getTomail()
{
return tomail;
}
public void setTomail(String tomail)
{
this.tomail = tomail;
}
public String getFrommail() {
return frommail;
}
public void setFrommail(String frommail) {
this.frommail = frommail;
} public String getSubject() {
return subject;
}
public void setSubject(String subject)
{
this.subject = subject;
}
public String getContent() {
return content;
}
public void setContent(String content)
{
this.content = content;
}
public String getImagecard()
{
return imagecard;
}
public void setImagecard(String imagecard)
{
this.imagecard = imagecard;
}
[1]