阅读背景:

javamail——初接触_红尘眷恋

来源:互联网 
package org.lazyzhong.test;

import java.util.Properties;

public class MailSenderInfo {
	//发送邮件的服务器的ip和端口
	private String mailServerHost;
	private String mailServerPort;
	//用户名和密码
	private String username;
	private String password;
	//主题和内容
	private String subject;
	private String content;
	//发送和接收者
	private String fromAddress;
	private String toAddress;
	//是否需要验证
	private boolean validate;
	//附件名
	private String[] attachFileNames;
	
	public Properties getProperties(){
		Properties p=new Properties();
		p.put("mail.smtp.host",this.mailServerHost);
		p.put("mail.smtp.port",this.mailServerPort);
		p.put("mail.smtp.auth",validate?"true":"false");
		return p;
	}
	
	public String getMailServerHost() {
		return mailServerHost;
	}
	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}
	public String getMailServerPort() {
		return mailServerPort;
	}
	public void setMailServerPort(String mailServerPort) {
		this.mailServerPort = mailServerPort;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	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 getFromAddress() {
		return fromAddress;
	}
	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}
	public String getToAddress() {
		return toAddress;
	}
	public void setToAddress(String toAddress) {
		this.toAddress = toAddress;
	}
	public boolean isValidate() {
		return validate;
	}
	public void setValidate(boolean validate) {
		this.validate = validate;
	}
	public String[] getAttachFileNames() {
		return attachFileNames;
	}
	public void setAttachFileNames(String[] attachFileNames) {
		this.attachFileNames = attachFileNames;
	}
	public MailSenderInfo() {
		super();
	}
	
}
package org.lazyzhong.test;

import java.ut



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: