发送邮件 空格 java_java实现邮件发送功能

所需jar包:javax.mail.jar

例子:

import java.util.Date;

import java.util.Properties;

import javax.activation.DataHandler;

import javax.activation.FileDataSource;

import javax.mail.Message.RecipientType;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeBodyPart;

import javax.mail.internet.MimeMessage;

import javax.mail.internet.MimeMultipart;

import javax.mail.internet.MimeUtility;

public class MailTest3 {

//参数

public static String myEmailAccount = "[email protected]"; //服务邮箱

public static String myEmailPassword = "xxxxxxxxxx"; //独立密码

public static String myEmailSMTPHost = "smtp.qq.com"; //服务主机

public static String receiveMail = "xxxxxxx@qq.

你可能感兴趣的:(发送邮件,空格,java)