首先,发送方法肯定没错
我用sina的发送 debug都没出错~见图
我是一次发送给多人,为什么debug没错而我在web mail里收不到呢?大家帮帮我吧~

解决方案 »

  1.   

    DEBUG: setDebug: JavaMail version 1.4.2
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "smtp.sina.com", port 25, isSSL false
    220 irxd5-187.sinamail.sina.com.cn ESMTP
    DEBUG SMTP: connected to host "smtp.sina.com", port: 25EHLO sl-92d51eb29214
    250-irxd5-187.sinamail.sina.com.cn
    250-8BITMIME
    250-SIZE 83886080
    250-AUTH PLAIN LOGIN
    250 AUTH=PLAIN LOGIN
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Found extension "SIZE", arg "83886080"
    DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
    DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN"
    DEBUG SMTP: Attempt to authenticate
    DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 
    AUTH LOGIN
    334 VXNlcm5hbWU6
    YmpfbGluZw==
    334 UGFzc3dvcmQ6
    ODcwODIy
    235 #2.0.0 OK Authenticated
    DEBUG SMTP: use8bit false
    MAIL FROM:<[email protected]>
    250 sender <[email protected]> ok
    RCPT TO:<[email protected]>
    250 recipient <[email protected]> ok
    DEBUG SMTP: Verified Addresses
    DEBUG SMTP:   [email protected]
    DATA
    354 go ahead
    Date: Wed, 26 May 2010 10:16:49 +0800 (CST)
    From: [email protected]
    To: [email protected]
    Message-ID: <31454114.0.1274840209406.JavaMail.user@sl-92d51eb29214>
    Subject: =?UTF-8?Q?=E6=B5=8B=E8=AF=95email!!!!!!!!!?=
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable=E6=B2=A1=E6=9C=89=E5=86=85=E5=AE=B9~~~~~~~~~~~~~
    .
    250 ok:  Message 115668940 accepted
    QUIT
    221 irxd5-187.sinamail.sina.com.cn
      

  2.   

    在自己的邮箱里好像还需要设置一下 
    POP/SMTP设置 开启,如果你的代码没有问题 100%就是这个问题了
      

  3.   

    是我源发送的邮箱设置吗?或者有什么办法能知道对方是否收到我的mail(回执不行)
      

  4.   

    JavaMail发送HTML(带图片,附件,样式表等类型的)邮件  
    http://www.01yun.com/article.asp?id=723 
      

  5.   

    我是可以发送的。。只不过不能收到邮件。。(用公司的mail发 只有公司的邮箱才能收到。。)我贴下代码
      

  6.   

    package mail.test;import java.util.Date;
    import java.util.Properties;import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;public class SendMail {
    /**
     * 发送简单邮件
     * 
     * @param str_from
     *            :发件人地址
     * @param str_to
     *            :收件人地址
     * @param str_title
     *            :邮件标题
     * @param str_content
     *            :邮件正文
     */
    public static void send(String str_from, String str_to, String str_title,
    String str_content) {
    try {
    // 建立邮件会话
    Properties props = new Properties(); // 用来在一个文件中存储键-值对的,其中键和值是用等号分隔的,
    // 存储发送邮件服务器的信息
    props.put("mail.smtp.host", Constant.mailServer);
    // 同时通过验证
    props.put("mail.smtp.auth", "true");
    // 根据属性新建一个邮件会话
    Session s = Session.getInstance(props);
    s.setDebug(true); // 有他会打印一些调试信息。 // 由邮件会话新建一个消息对象
    MimeMessage message = new MimeMessage(s); // 设置邮件
    InternetAddress from = new InternetAddress(str_from); 
    message.setFrom(from); // 设置发件人的地址
    // 
    // //设置收件人,并设置其接收类型为TO
    InternetAddress to = new InternetAddress(str_to); 
    message.setRecipient(Message.RecipientType.TO, to); // 设置标题
    message.setSubject(str_title); // java学习 // 设置信件内容
    message.setText(str_content); // 发送文本邮件 //你好吗?
    // message.setContent(str_content, "text/html;charset=gbk");
    // //发送HTML邮件 //<b>你好</b><br><p>大家好</p>
    // 设置发信时间
    message.setSentDate(new Date()); // 存储邮件信息
    message.saveChanges(); // 发送邮件
    Transport transport = s.getTransport("smtp");
    // 以smtp方式登录邮箱,第一个参数是发送邮件用的邮件服务器SMTP地址,第二个参数为用户名,第三个参数为密码
    transport.connect(Constant.mailServer, Constant.mailCount,
    Constant.mailPassword);
    // 发送邮件,其中第二个参数是所有已设好的收件人地址
    transport.sendMessage(message, message.getAllRecipients());
    transport.close(); } catch (Exception e) {
    e.printStackTrace();
    }
    } public static void main(String[] args) throws InterruptedException {

    String string[] = new String[10];
    string[0] = "[email protected]";
    string[1] = "[email protected]";
    string[2] = "[email protected]";
    string[3] = "[email protected]";
    string[4] = "[email protected]";
    String from = "[email protected]";
    for (int i = 0; i < string.length; i++) {
    if (string[i] != null) {
    send(from,string[i],"测试email!!!!!!!!!","没有内容~~~~~~~~~~~~~");
    System.out.println(i+"!!!");
    Thread.sleep(10000);
    }
    }
    }
    }