当前位置: 首页>>代码示例>>Java>>正文


Java SimpleMailMessage.getSubject方法代码示例

本文整理汇总了Java中org.springframework.mail.SimpleMailMessage.getSubject方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleMailMessage.getSubject方法的具体用法?Java SimpleMailMessage.getSubject怎么用?Java SimpleMailMessage.getSubject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.mail.SimpleMailMessage的用法示例。


在下文中一共展示了SimpleMailMessage.getSubject方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendEmailInvite

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Send the invite to a user who already exists in the system.
 * 
 * @param invite
 */
 public void sendEmailInvite(IrUser invitingUser, GroupWorkspace groupWorkspace, String email, String inviteMessage)	{
	SimpleMailMessage message = new SimpleMailMessage(userWorkspaceInviteUserExists);
	message.setTo(email);
	
	String subject = message.getSubject();
	subject = StringUtils.replace(subject, "%FIRST_NAME%", invitingUser.getFirstName());
	subject = StringUtils.replace(subject, "%LAST_NAME%",  invitingUser.getLastName());
	message.setSubject(subject);
	
	String text = message.getText();
	
	text = StringUtils.replace(text, "%NAME%", groupWorkspace.getName());
	text = StringUtils.replace(text, "%BASE_WEB_APP_PATH%", baseWebAppPath);
	if( inviteMessage != null && !inviteMessage.trim().equals(""))
	{
	    text = text.concat(inviteMessage);
	}
	message.setText(text);
	sendEmail(message);
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:26,代码来源:DefaultGroupWorkspaceInviteService.java

示例2: sendEmailToNotExistingUser

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Send an email to a user who has not yet registered in the system
 * 
 * @param invite
 */
private void sendEmailToNotExistingUser(GroupWorkspaceEmailInvite invite)
{
	SimpleMailMessage message = new SimpleMailMessage(userWorkspaceInviteUserNotExistsMessage);
	message.setTo(invite.getInviteToken().getEmail());

	String subject = message.getSubject();
	subject = StringUtils.replace(subject, "%FIRST_NAME%", invite.getInviteToken().getInvitingUser().getFirstName());
	subject = StringUtils.replace(subject, "%LAST_NAME%", invite.getInviteToken().getInvitingUser().getLastName());
	message.setSubject(subject);

	String text = message.getText();
	
	text = StringUtils.replace(text, "%NAME%", invite.getGroupWorkspace().getName());
	text = StringUtils.replace(text, "%TOKEN%", invite.getInviteToken().getToken());
	text = StringUtils.replace(text, "%BASE_WEB_APP_PATH%", baseWebAppPath);
	if( invite.getInviteToken().getInviteMessage() != null )
	{
	    text = text.concat(invite.getInviteToken().getInviteMessage());
	}
	message.setText(text);
	sendEmail(message);
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:28,代码来源:DefaultGroupWorkspaceInviteService.java

示例3: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
	 * 이메일을 전송한다.
	 * 
	 * @param mntrngLog
	 *            모니터링 대상정보
	 * @return
	 * 
	 */
	private void sendEmail(DbMntrngLogVO mntrngLog) {
		String subject = null;
		String text = null;
		String errorContents = null;

		SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
		// 수신자
		msg.setTo(mntrngLog.getMngrEmailAddr());
		// 메일제목
		subject = msg.getSubject();
		subject = StringUtil.replace(subject, "{모니터링종류}", "DB서비스모니터링");
		msg.setSubject(subject);
		// 메일내용
		text = msg.getText();
		text = StringUtil.replace(text, "{모니터링종류}", "DB서비스모니터링");
		errorContents = "데이타소스명 : " + mntrngLog.getDataSourcNm() + "\n";
		errorContents = errorContents + "서버명  : " + mntrngLog.getServerNm() + "\n";
		errorContents = errorContents + "DBMS종류 : " + mntrngLog.getDbmsKindNm() + "\n";
		errorContents = errorContents + "체크SQL : " + mntrngLog.getCeckSql() + "\n";
		errorContents = errorContents + "상태 : " + mntrngLog.getMntrngSttusNm() + "\n";
		errorContents = errorContents + "모니터링시각 : " + mntrngLog.getCreatDt() + "\n";
		errorContents = errorContents + "에러메시지 : " + mntrngLog.getLogInfo() + "\n";
		text = StringUtil.replace(text, "{에러내용}", errorContents);
		msg.setText(text);

//		this.mntrngMailSender.send(msg);
	}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:36,代码来源:DbMntrngScheduling.java

示例4: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
	 * 이메일을 전송한다.
	 * 
	 * @return
	 * 
	 * @param target
	 */
	private void sendEmail(ProcessMonVO target) {

		String subject = null;
		String text = null;
		String errorContents = null;

		SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
		// 수신자
		msg.setTo(target.getMngrEmailAddr());
		// 메일제목
		subject = msg.getSubject();
		subject = StringUtil.replace(subject, "{모니터링종류}", "프로세스모니터링");
		msg.setSubject(subject);
		// 메일내용
		text = msg.getText();
		text = StringUtil.replace(text, "{모니터링종류}", "프로세스모니터링");
		errorContents = "프로세스명 : ";
		errorContents += target.getProcessNm();
		errorContents += "\n";
		errorContents += "상태 : ";
		errorContents += target.getProcsSttus();
		errorContents += "\n";
		errorContents += "모티터링 시각 : ";
		errorContents += DateUtil.convertDate(target.getCreatDt(), "", "", "");
		errorContents += "\n";
		if (target.getLogInfo() != null && !target.getLogInfo().equals("")) {
			errorContents += target.getProcessNm() + " 의 프로세스 상태가 비정상입니다.  \n로그를 확인해주세요.";
		}
		text = StringUtil.replace(text, "{에러내용}", errorContents);
		msg.setText(text);

//		this.mntrngMailSender.send(msg);
	}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:41,代码来源:ProcessMonScheduling.java

示例5: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * 이메일을 전송한다.
 * 
 * @param mntrngLog
 *            모니터링 대상정보
 * @return
 * 
 */
private void sendEmail(TrsmrcvMntrngLogVO mntrngLog) {
	String subject = null;
	String text = null;
	String errorContents = null;

	SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
	// 수신자
	msg.setTo(mntrngLog.getMngrEmailAddr());
	// 메일제목
	subject = msg.getSubject();
	subject = StringUtil.replace(subject, "{모니터링종류}", "송수신모니터링");
	msg.setSubject(subject);
	// 메일내용
	text = msg.getText();
	text = StringUtil.replace(text, "{모니터링종류}", "송수신모니터링");
	errorContents = "연계ID : " + mntrngLog.getCntcId() + "\n";
	errorContents = errorContents + "연계명 : " + mntrngLog.getCntcNm() + "\n";
	errorContents = errorContents + "테스트클래스명 : " + mntrngLog.getTestClassNm() + "\n";
	errorContents = errorContents + "상태 : " + mntrngLog.getMntrngSttusNm() + "\n";
	errorContents = errorContents + "모니터링시각 : " + mntrngLog.getCreatDt() + "\n";
	errorContents = errorContents + "에러메시지 : " + mntrngLog.getLogInfo() + "\n";
	text = StringUtil.replace(text, "{에러내용}", errorContents);
	msg.setText(text);

	this.mntrngMailSender.send(msg);
}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:35,代码来源:TrsmrcvMntrngScheduling.java

示例6: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
	 * 이메일을 전송한다.
	 * 
	 * @param target
	 *            모니터링 대상정보
	 * @return
	 * 
	 */
	private void sendEmail(NtwrkSvcMntrngVO target) {
		String subject = null;
		String text = null;
		String errorContents = null;

		SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
		// 수신자
		msg.setTo(target.getMngrEmailAddr());
		// 메일제목
		subject = msg.getSubject();
		subject = StringUtil.replace(subject, "{모니터링종류}", "네트워크서비스모니터링");
		msg.setSubject(subject);
		// 메일내용
		text = msg.getText();
		text = StringUtil.replace(text, "{모니터링종류}", "네트워크서비스모니터링");
		errorContents = "서버명 : ";
		errorContents += target.getSysNm();
		errorContents += "\n";
		errorContents += "서버IP : ";
		errorContents += target.getSysIp();
		errorContents += "\n";
		errorContents += "서버포트 : ";
		errorContents += target.getSysPort();
		errorContents += "\n";
		errorContents += "상태 : ";
		errorContents += target.getMntrngSttus();
		errorContents += "\n";
		errorContents += "모니터링 시각 : ";
		errorContents += DateUtil.convertDate(target.getCreatDt(), "", "", "");
		errorContents += "\n";
		errorContents += target.getSysNm() + " 의 네트워크 서비스 상태가 비정상입니다. \n로그를 확인해주세요.";
		text = StringUtil.replace(text, "{에러내용}", errorContents);
		msg.setText(text);

//		this.mntrngMailSender.send(msg);
	}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:45,代码来源:NtwrkSvcMntrngScheduling.java

示例7: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * 이메일을 전송한다.
 * 
 * @return
 * 
 * @param target
 */
private void sendEmail(HttpMntrngVO target) {

	String subject = null;
	String text = null;
	String errorContents = null;

	SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
	// 수신자
	msg.setTo(target.getMngrEmailAddr());
	// 메일제목
	subject = msg.getSubject();
	subject = StringUtil.replace(subject, "{모니터링종류}", "HTTP서비스 모니터링");
	msg.setSubject(subject);
	// 메일내용
	text = msg.getText();
	text = StringUtil.replace(text, "{모니터링종류}", "HTTP서비스 모니터링");
	errorContents = "웹서비스종류 : ";
	errorContents += target.getWebKind();
	errorContents += "\n";
	errorContents += "시스템URL : ";
	errorContents += target.getSiteUrl();
	errorContents += "\n";
	errorContents += "상태 : ";
	errorContents += target.getHttpSttusCd();
	errorContents += "\n";
	errorContents += "모티터링 시각 : ";
	errorContents += DateUtil.convertDate(target.getCreatDt(), "", "", "");
	errorContents += "\n";
	if (target.getLogInfo() != null && !target.getLogInfo().equals("")) {
		errorContents += target.getWebKind() + " 의 프로세스 상태가 비정상입니다.  \n로그를 확인해주세요.";
	}
	text = StringUtil.replace(text, "{에러내용}", errorContents);
	msg.setText(text);

	this.mntrngMailSender.send(msg);
}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:44,代码来源:HttpMntrngScheduling.java

示例8: sendEmailToExistingUser

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Sends email invitation for collaborating on a file
 * 
 *  @see edu.ur.ir.user.InviteUserService#sendEmailToExistingUser(FileInviteInfo)
 */
public void sendEmailToExistingUser(FileInviteInfo inviteInfo) {
	
	SimpleMailMessage message = new SimpleMailMessage(userExistMailMessage);
	message.setTo(inviteInfo.getInviteToken().getEmail());
	
	String subject = message.getSubject();
	subject = StringUtils.replace(subject, "%FIRST_NAME%", inviteInfo.getInviteToken().getInvitingUser().getFirstName());
	subject = StringUtils.replace(subject, "%LAST_NAME%", inviteInfo.getInviteToken().getInvitingUser().getLastName());
	message.setSubject(subject);
	
	String text = message.getText();
	
	// Get the name of files
	StringBuffer names = new StringBuffer();
	VersionedFile[] files = inviteInfo.getFiles().toArray(new VersionedFile[0]);
	for(int i = 0; i<files.length; i++) {
		names.append(files[i].getName());
		if ( i != (files.length-1) ) {
			names.append(", ");
		}
	}
	
	text = StringUtils.replace(text, "%NAME%", names.toString());
	text = StringUtils.replace(text, "%BASE_WEB_APP_PATH%", baseWebAppPath);
	if( inviteInfo.getInviteToken().getInviteMessage() != null )
	{
	    text = text.concat(inviteInfo.getInviteToken().getInviteMessage());
	}
	message.setText(text);
	sendEmail(message);
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:37,代码来源:DefaultInviteUserService.java

示例9: sendEmailToNotExistingUser

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Sends email invitation for collaborating on a file
 * 
 *  @see edu.ur.ir.user.InviteUserService#sendEmailToNotExistingUser(FileInviteInfo)
 */
public void sendEmailToNotExistingUser(FileInviteInfo inviteInfo) {
	SimpleMailMessage message = new SimpleMailMessage(userNotExistMailMessage);
	message.setTo(inviteInfo.getInviteToken().getEmail());

	String subject = message.getSubject();
	subject = StringUtils.replace(subject, "%FIRST_NAME%", inviteInfo.getInviteToken().getInvitingUser().getFirstName());
	subject = StringUtils.replace(subject, "%LAST_NAME%", inviteInfo.getInviteToken().getInvitingUser().getLastName());
	message.setSubject(subject);

	String text = message.getText();

	// Get the name of files
	StringBuffer names = new StringBuffer();
	VersionedFile[] files = inviteInfo.getFiles().toArray(new VersionedFile[0]);
	for(int i = 0; i<files.length; i++) {
		names.append(files[i].getName());
		if ( i != (files.length-1) ) {
			names.append(", ");
		}
	}
	
	text = StringUtils.replace(text, "%NAME%", names.toString());
	text = StringUtils.replace(text, "%TOKEN%", inviteInfo.getInviteToken().getToken());
	text = StringUtils.replace(text, "%BASE_WEB_APP_PATH%", baseWebAppPath);
	if( inviteInfo.getInviteToken().getInviteMessage() != null )
	{
	    text = text.concat(inviteInfo.getInviteToken().getInviteMessage());
	}
	message.setText(text);
	sendEmail(message);
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:37,代码来源:DefaultInviteUserService.java

示例10: sendEmailToUnShare

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Sends email to inform the user that the document is removed from sharing
 * 
 * @param from Email from address
 * @param to Email To address
 * @param fileName Name of the unshared file 
 */
private void sendEmailToUnShare(String from, String to, String fileName) {
	log.debug("Sending email to unshare to " + to);
	SimpleMailMessage message = new SimpleMailMessage(unShareMailMessage);
	message.setTo(to);
	
	String subject = message.getSubject();
	message.setSubject(subject);

	String text = message.getText();
	text = StringUtils.replace(text, "%NAME%", fileName);
	message.setText(text);
	
	sendEmail(message);
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:22,代码来源:DefaultInviteUserService.java

示例11: notifyCollaboratorsOfNewVersion

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * Notify users that a new version of a file has been added.
 * 
 * @param personalFile - personal file that has been updated.
 * @return - list of collaborators where the email could not be sent
 */
public List<FileCollaborator> notifyCollaboratorsOfNewVersion(PersonalFile personalFile)
{
	List<FileCollaborator> emailsNotSent = new LinkedList<FileCollaborator>();
	Set<FileCollaborator> collaborators = personalFile.getVersionedFile().getCollaborators();
	for( FileCollaborator collaborator : collaborators )
	{
		try 
		{
			SimpleMailMessage message = new SimpleMailMessage(newFileVersionMailMessage);
			message.setTo(collaborator.getCollaborator().getDefaultEmail().getEmail());
			
			String subject = message.getSubject();
			subject = StringUtils.replace(subject, "%FIRST_NAME%", personalFile.getOwner().getFirstName());
			subject = StringUtils.replace(subject, "%LAST_NAME%", personalFile.getOwner().getLastName());
			subject = StringUtils.replace(subject, "%NAME%", personalFile.getName());
			message.setSubject(subject);
			
			String text = message.getText();
			
			// Get the name of files
			text = StringUtils.replace(text, "%NAME%", personalFile.getName());
			text = StringUtils.replace(text, "%BASE_WEB_APP_PATH%", baseWebAppPath);
			
			if( personalFile.getDescription() != null && !personalFile.getDescription().trim().equals(""))
			{
				text = text + "\n Notes: \n\n" + personalFile.getDescription();
			}
			
			message.setText(text);
			sendEmail(message);
		} 
		catch(IllegalStateException e) 
		{
			emailsNotSent.add(collaborator);
		}
	}
	return emailsNotSent;
}
 
开发者ID:nate-rcl,项目名称:irplus,代码行数:45,代码来源:DefaultInviteUserService.java

示例12: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
 * 이메일을 전송한다.
 * 
 * @param serverResrceMntrngVO
 *            - 서버자원모니터링 Vo
 * @return
 * 
 * @param serverResrceMntrngVO
 */
public void sendEmail(ServerResrceMntrngVO serverResrceMntrngVO) {
	String subject = null;
	String text = null;
	String errorContents = null;

	SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
	// 수신자
	msg.setTo(serverResrceMntrngVO.getMngrEamilAddr());
	// 메일제목
	subject = msg.getSubject();
	subject = StringUtil.replace(subject, "{모니터링종류}", "서버자원서비스모니터링");
	msg.setSubject(subject);
	// 메일내용
	text = msg.getText();
	text = StringUtil.replace(text, "{모니터링종류}", "서버자원서비스모니터링");
	errorContents = "서버명 : ";
	errorContents += serverResrceMntrngVO.getServerNm();
	errorContents += "\n";
	errorContents += "서버IP : ";
	errorContents += serverResrceMntrngVO.getServerEqpmnIp();
	errorContents += "\n";
	errorContents += "CPU사용률 : ";
	errorContents += serverResrceMntrngVO.getCpuUseRt();
	errorContents += "\n";
	errorContents += "메모리사용률 : ";
	errorContents += serverResrceMntrngVO.getMoryUseRt();
	errorContents += "\n";
	errorContents += "서비스상태 : 비정상";
	// errorContents += serverResrceMntrngVO.getSvcSttusNm();
	errorContents += "\n";
	errorContents += "내용 : ";
	errorContents += serverResrceMntrngVO.getLogInfo();
	errorContents += "\n";
	errorContents += "생성일시 : ";
	errorContents += DateUtil.convertDate(serverResrceMntrngVO.getCreatDt(), "", "", "");
	errorContents += "\n";
	errorContents += serverResrceMntrngVO.getServerNm() + " 의 서버자원 서비스 상태가 비정상입니다. \n로그를 확인해주세요.";
	text = StringUtil.replace(text, "{에러내용}", errorContents);
	msg.setText(text);

	this.mntrngMailSender.send(msg);
}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:52,代码来源:ServerResrceMntrngScheduling.java

示例13: sendEmail

import org.springframework.mail.SimpleMailMessage; //导入方法依赖的package包/类
/**
	 * 이메일을 전송한다.
	 * 
	 * @param target
	 *            모니터링 대상정보
	 * @return
	 * 
	 */
	private void sendEmail(FileSysMntrngVO fileSysMntrng) {
		String subject = null;
		String text = null;
		String errorContents = null;

		SimpleMailMessage msg = new SimpleMailMessage(this.mntrngMessage);
		// 수신자
		msg.setTo(fileSysMntrng.getMngrEmailAddr());
		// 메일제목
		subject = msg.getSubject();
		subject = StringUtil.replace(subject, "{모니터링종류}", "파일시스템모니터링");
		msg.setSubject(subject);
		// 메일내용
		text = msg.getText();
		text = StringUtil.replace(text, "{모니터링종류}", "파일시스템모니터링");
		errorContents = "파일시스템명 : ";
		errorContents += fileSysMntrng.getFileSysNm();
		errorContents += "\n";
		errorContents += "파일시스템관리명 : ";
		errorContents += fileSysMntrng.getFileSysManageNm();
		errorContents += "\n";

		if (fileSysMntrng.getLogInfo() != null && !fileSysMntrng.getLogInfo().equals("")) {
			errorContents += "해당파일의 파일시스템 정보를 가져오는중 에러가 발생하였습니다.";
		} else {
			errorContents += "크기 : ";
			errorContents += fileSysMntrng.getFileSysMg();
			errorContents += "GB\n";
			errorContents += "임계치 : ";
			errorContents += fileSysMntrng.getFileSysThrhld();
			errorContents += "GB\n";
			errorContents += "사용량 : ";
			errorContents += fileSysMntrng.getFileSysUsgQty();
			errorContents += "GB\n";
		}

		errorContents += "상태 : ";
		errorContents += fileSysMntrng.getMntrngSttus();
		errorContents += "\n";
		errorContents += "모니터링 시각 : ";
		errorContents += DateUtil.convertDate(fileSysMntrng.getCreatDt(), "", "", "");
		errorContents += "\n";
		if (fileSysMntrng.getLogInfo() != null && !fileSysMntrng.getLogInfo().equals("")) {
			errorContents += fileSysMntrng.getFileSysManageNm() + " 의 파일시스템 상태가 비정상입니다.  \n로그를 확인해주세요.";
		} else {
			errorContents += fileSysMntrng.getFileSysManageNm() + " 의 파일시스템이 임계치를 넘었습니다.";
		}
		text = StringUtil.replace(text, "{에러내용}", errorContents);
		msg.setText(text);

//		this.mntrngMailSender.send(msg);
	}
 
开发者ID:aramsoft,项目名称:aramcomp,代码行数:61,代码来源:FileSysMntrngScheduling.java


注:本文中的org.springframework.mail.SimpleMailMessage.getSubject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。