javamail邮件正文带图片 (javamail实现)

http://www.iteye.com/topic/668971


	public static void main(String[] args) {
		SendMailOneServer themail = new SendMailOneServer("smtp.*.com");

		String mailbody = "<a href=\"http://www.hongyun2000.com/heuimail\"><img src=\"cid:aaa\" /></a><br />最近在运营一个新网站,有空去看看,给点意见,谢谢<a href=\"http://www.hongyun2000.com/heuimail\">www.hongyun2000.com</a>";
		themail.setNeedAuth(false);

		themail.setSubject("小娇和小婉新图");
		themail.addFileAffix("c:/1.jpg");// 附件文件路径
		themail.setBody(mailbody);

		themail.setFrom("**@**.com");

		long start = System.currentTimeMillis();
		System.out.println("====================================================\n准备发邮件给" + "*");
		themail.setTo("*");
		themail.sendout();
		long end = System.currentTimeMillis(); // 获取运行结束时间
		System.out.println("发送该邮件时间: " + (end - start) + "ms");
	}


需要mail.jar。我的下载中有,免费

你可能感兴趣的:(c,String,javamail)