⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mailsender.java.svn-base

📁 javamail使用例子
💻 SVN-BASE
字号:
package com.gsta.bimp.modules.mail;

import com.gsta.bnet.ecommerce.util.StringUtil;

/**
 * Title:MailSender.java<br>
 * Description: 邮件发送者<br>
 * Date:2008-3-4<br>
 * 
 * @author :dengwenguang<br>
 * @version 1.0<br>
 */
public class MailSender {
	private String smtpHost;

	private String fromAddress;

	private boolean isAuthentication = true;

	private String userName;

	private String password;

	/**
	 * @return the fromAddress
	 */
	public String getFromAddress() {
		return fromAddress;
	}

	/**
	 * @param fromAddress
	 *            the fromAddress to set
	 */
	public void setFromAddress(String fromAddress) {
		this.fromAddress = fromAddress;
	}

	public boolean getIsAuthentication() {
		return isAuthentication;
	}

	public void setIsAuthentication(boolean isAuthentication) {
		this.isAuthentication = isAuthentication;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		if (isAuthentication && !StringUtil.chkNull(password)) {
			throw new NullPointerException();
		}
		return password;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the smtpHost
	 */
	public String getSmtpHost() {
		if (!StringUtil.chkNull(smtpHost)) {
			throw new NullPointerException();
		}
		return smtpHost;
	}

	/**
	 * @param smtpHost
	 *            the smtpHost to set
	 */
	public void setSmtpHost(String smtpHost) {
		this.smtpHost = smtpHost;
	}

	/**
	 * @return the userName
	 */
	public String getUserName() {
		if (isAuthentication && !StringUtil.chkNull(userName)) {
			throw new NullPointerException();
		}
		return userName;
	}

	/**
	 * @param userName
	 *            the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -