All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ajaxjs.cms.utils.email.DefaultSendEmail Maven / Gradle / Ivy

The newest version!
package com.ajaxjs.cms.utils.email;

import java.io.IOException;

import com.ajaxjs.net.mail.Mail;
import com.ajaxjs.net.mail.MailException;
import com.ajaxjs.net.mail.Sender;

public class DefaultSendEmail implements SendEmail {

	@Override
	public boolean sendMail(Mail mail) {

		mail.setMailServer("smtp.163.com");
		mail.setAccount("pacoweb");
		mail.setFrom("[email protected]");
		mail.setTo("[email protected]");
		mail.setSubject("hihi你好");
		mail.setHTML_body(true);
		mail.setContent("dsfds放到沙发dfsfdfdsfds");

		try (Sender sender = new Sender(mail)) {
			return sender.sendMail();
		} catch (IOException | MailException e) {
			e.printStackTrace();
			return false;
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy