extension-关于android里面发邮件的问题,下面是我运行时候的log,请各位帮我看一下。

问题描述

关于android里面发邮件的问题,下面是我运行时候的log,请各位帮我看一下。
04-07 14:06:05.294: I/System.out(2970): DEBUG: JavaMail version 1.4.1
04-07 14:06:05.294: I/System.out(2970): DEBUG: not loading file: /system/lib/javamail.providers
04-07 14:06:05.298: I/System.out(2970): DEBUG: java.io.FileNotFoundException: /system/lib/javamail.providers: open failed: ENOENT (No such file or directory)
04-07 14:06:05.298: I/System.out(2970): DEBUG: !anyLoaded
04-07 14:06:05.298: I/System.out(2970): DEBUG: not loading resource: /META-INF/javamail.providers
04-07 14:06:05.298: I/System.out(2970): DEBUG: not loading resource: /META-INF/javamail.default.providers
04-07 14:06:05.298: I/System.out(2970): DEBUG: failed to load any providers using defaults
04-07 14:06:05.298: I/System.out(2970): DEBUG: Tables of loaded providers
04-07 14:06:05.298: I/System.out(2970): DEBUG: Providers Listed By Class Name: {com.sun.mail.imap.IMAPStore=javax.mail.Provider[STOREimapcom.sun.mail.imap.IMAPStoreSun Microsystems Inc.1.4.1] com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORTsmtpcom.sun.mail.smtp.SMTPTransportSun Microsystems Inc.1.4.1] com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STOREpop3scom.sun.mail.pop3.POP3SSLStoreSun Microsystems Inc.1.4.1] com.sun.mail.pop3.POP3Store=javax.mail.Provider[STOREpop3com.sun.mail.pop3.POP3StoreSun Microsystems Inc.1.4.1] com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORTsmtpscom.sun.mail.smtp.SMTPSSLTransportSun Microsystems Inc.1.4.1] com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STOREimapscom.sun.mail.imap.IMAPSSLStoreSun Microsystems Inc.1.4.1]}
04-07 14:06:05.298: I/System.out(2970): DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STOREimapscom.sun.mail.imap.IMAPSSLStoreSun Microsystems Inc.1.4.1] smtp=javax.mail.Provider[TRANSPORTsmtpcom.sun.mail.smtp.SMTPTransportSun Microsystems Inc.1.4.1] pop3=javax.mail.Provider[STOREpop3com.sun.mail.pop3.POP3StoreSun Microsystems Inc.1.4.1] pop3s=javax.mail.Provider[STOREpop3scom.sun.mail.pop3.POP3SSLStoreSun Microsystems Inc.1.4.1] imap=javax.mail.Provider[STOREimapcom.sun.mail.imap.IMAPStoreSun Microsystems Inc.1.4.1] smtps=javax.mail.Provider[TRANSPORTsmtpscom.sun.mail.smtp.SMTPSSLTransportSun Microsystems Inc.1.4.1]}
04-07 14:06:05.298: I/System.out(2970): DEBUG: not loading resource: /META-INF/javamail.default.address.map
04-07 14:06:05.298: I/System.out(2970): DEBUG: !anyLoaded
04-07 14:06:05.302: I/System.out(2970): DEBUG: not loading resource: /META-INF/javamail.address.map
04-07 14:06:05.302: I/System.out(2970): DEBUG: not loading file: /system/lib/javamail.address.map
04-07 14:06:05.302: I/System.out(2970): DEBUG: java.io.FileNotFoundException: /system/lib/javamail.address.map: open failed: ENOENT (No such file or directory)
04-07 14:06:05.302: I/System.out(2970): DEBUG: failed to load address map using defaults
04-07 14:06:05.326: D/dalvikvm(2970): GC_CONCURRENT freed 195K 8% free 8162K/8839K paused 11ms+0ms total 17ms
04-07 14:06:05.350: I/System.out(2970): DEBUG: getProvider() returning javax.mail.Provider[TRANSPORTsmtpcom.sun.mail.smtp.SMTPTransportSun Microsystems Inc.1.4.1]
04-07 14:06:05.350: I/System.out(2970): DEBUG SMTP: useEhlo true useAuth true
04-07 14:06:05.350: I/System.out(2970): DEBUG SMTP: trying to connect to host ""smtp.qq.com"" port 25 isSSL false
04-07 14:06:05.458: I/System.out(2970): 220 smtp.qq.com Esmtp QQ Mail Server

04-07 14:06:05.458: I/System.out(2970): DEBUG SMTP: connected to host ""smtp.qq.com"" port: 25
04-07 14:06:05.458: I/System.out(2970): EHLO localhost

04-07 14:06:05.494: I/System.out(2970): 250-smtp.qq.com

04-07 14:06:05.494: I/System.out(2970): 250-PIPELINING

04-07 14:06:05.494: I/System.out(2970): 250-SIZE 52428800

04-07 14:06:05.494: I/System.out(2970): 250-STARTTLS

04-07 14:06:05.494: I/System.out(2970): 250-AUTH LOGIN PLAIN

04-07 14:06:05.494: I/System.out(2970): 250-AUTH=LOGIN

04-07 14:06:05.494: I/System.out(2970): 250-MAILCOMPRESS

04-07 14:06:05.494: I/System.out(2970): 250 8BITMIME

04-07 14:06:05.498: I/System.out(2970): DEBUG SMTP: Found extension ""PIPELINING"" arg """"
04-07 14:06:05.498: I/System.out(2970): DEBUG SMTP: Found extension ""SIZE"" arg ""52428800""
04-07 14:06:05.498: I/System.out(2970): DEBUG SMTP: Found extension ""STARTTLS"" arg """"
04-07 14:06:05.498: I/System.out(2970): DEBUG SMTP: Found extension ""AUTH"" arg ""LOGIN PLAIN""
04-07 14:06:05.502: I/System.out(2970): DEBUG SMTP: Found extension ""AUTH=LOGIN"" arg """"
04-07 14:06:05.502: I/System.out(2970): DEBUG SMTP: Found extension ""MAILCOMPRESS"" arg """"
04-07 14:06:05.502: I/System.out(2970): DEBUG SMTP: Found extension ""8BITMIME"" arg """"
04-07 14:06:05.502: I/System.out(2970): DEBUG SMTP: Attempt to authenticate
04-07 14:06:05.502: I/System.out(2970): AUTH LOGIN

04-07 14:06:05.542: I/System.out(2970): 334 VXNlcm5hbWU6

04-07 14:06:05.542: I/System.out(2970): MTQ0Njc5MDY4MUBxcS5jb20g

04-07 14:06:05.590: I/System.out(2970): DEBUG SMTP: EOF: [EOF]
04-07 14:06:05.590: I/System.out(2970): DEBUG SMTP: useEhlo true useAuth true
04-07 14:06:05.590: I/System.out(2970): DEBUG SMTP: trying to connect to host ""smtp.qq.com"" port 25 isSSL false
04-07 14:06:05.666: I/System.out(2970): 220 smtp.qq.com Esmtp QQ Mail Server

04-07 14:06:05.666: I/System.out(2970): DEBUG SMTP: connected to host ""smtp.qq.com"" port: 25
04-07 14:06:05.666: I/System.out(2970): EHLO localhost

04-07 14:06:05.702: I/System.out(2970): 250-smtp.qq.com

04-07 14:06:05.702: I/System.out(2970): 250-PIPELINING

04-07 14:06:05.706: I/System.out(2970): 250-SIZE 52428800

04-07 14:06:05.706: I/System.out(2970): 250-STARTTLS

04-07 14:06:05.706: I/System.out(2970): 250-AUTH LOGIN PLAIN

04-07 14:06:05.706: I/System.out(2970): 250-AUTH=LOGIN

04-07 14:06:05.706: I/System.out(2970): 250-MAILCOMPRESS

04-07 14:06:05.706: I/System.out(2970): 250 8BITMIME

04-07 14:06:05.706: I/System.out(2970): DEBUG SMTP: Found extension ""PIPELINING"" arg """"
04-07 14:06:05.706: I/System.out(2970): DEBUG SMTP: Found extension ""SIZE"" arg ""52428800""
04-07 14:06:05.706: I/System.out(2970): DEBUG SMTP: Found extension ""STARTTLS"" arg """"
04-07 14:06:05.710: I/System.out(2970): DEBUG SMTP: Found extension ""AUTH"" arg ""LOGIN PLAIN""
04-07 14:06:05.710: I/System.out(2970): DEBUG SMTP: Found extension ""AUTH=LOGIN"" arg """"
04-07 14:06:05.710: I/System.out(2970): DEBUG SMTP: Found extension ""MAILCOMPRESS"" arg """"
04-07 14:06:05.710: I/System.out(2970): DEBUG SMTP: Found extension ""8BITMIME"" arg """"
04-07 14:06:05.710: I/System.out(2970): DEBUG SMTP: Attempt to authenticate
04-07 14:06:05.710: I/System.out(2970): AUTH LOGIN

04-07 14:06:05.754: I/System.out(2970): 334 VXNlcm5hbWU6

04-07 14:06:05.754: I/System.out(2970): MTQ0Njc5MDY4MUBxcS5jb20=

04-07 14:06:05.802: I/System.out(2970): DEBUG SMTP: EOF: [EOF]
04-07 14:06:05.806: W/System.err(2970): javax.mail.AuthenticationFailedException
04-07 14:06:05.806: W/System.err(2970): at javax.mail.Service.connect(Service.java:319)
04-07 14:06:05.806: W/System.err(2970): at com.example.sendemaildemo02.MailExample.send(MailExample.java:79)
04-07 14:06:05.806: W/System.err(2970): at com.example.sendemaildemo02.MainActivity$1$1.run(MainActivity.java:81)
04-07 14:06:05.806: W/System.err(2970): at java.lang.Thread.run(Thread.java:856)

解决方案

关键是qq的验证你没有通过
看看这个例子:http://blog.csdn.net/dyllove98/article/details/9371885 作者说它通过qq发邮件

解决方案二:
04-07 14:06:05.294: I/System.out(2970): DEBUG: not loading file: /system/lib/javamail.providers
04-07 14:06:05.298: I/System.out(2970): DEBUG: java.io.FileNotFoundException: /system/lib/javamail.providers: open failed: ENOENT (No such file or directory)
找不到邮件的provider,后面还有address map没找到,不过最关键的是
04-07 14:06:05.806: W/System.err(2970): javax.mail.AuthenticationFailedException

不过不上code,很难清楚为什么

解决方案三:
访问不到provider先看看你<权限>加了没有吧。。。

解决方案四:
这是 我的代码,实在android里面写的
send.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
new Thread(new Runnable() {

                @Override                public void run() {                    try{                    String userName=""17764576391@163.com"";                    String password=""******"";                    String smtp_server=""smtp.163.com"";                    String from_mail_address=userName;                    String to_mail_address=""345521625@qq.com"";                    Authenticator auth=new PopupAuthenticator(userNamepassword);                    Properties mailProps=new Properties();                    mailProps.put(""mail.smtp.host"" smtp_server);                    mailProps.put(""mail.smtp.auth""true"");                    mailProps.put(""username"" userName);                    mailProps.put(""password"" password);                    Session mailSession=Session.getDefaultInstance(mailProps auth);                    mailSession.setDebug(true);                    MimeMessage message=new MimeMessage(mailSession);                    message.setFrom(new InternetAddress(from_mail_address));                    message.setRecipient(Message.RecipientType.TO new InternetAddress(to_mail_address));                    message.setSubject(""Mail Testw"");                    MimeMultipart multi=new MimeMultipart();                    BodyPart textBodyPart=new MimeBodyPart();                    textBodyPart.setText(""电子邮件测试内容w"");                    //textBodyPart.setFileName(""37af4739a11fc9d6b311c712.jpg"");                    multi.addBodyPart(textBodyPart);                    message.setContent(multi);                    message.saveChanges();                    Transport transport = mailSession.getTransport(""smtp"");                    transport.connect(""smtp.163.com""251446790681@163.com""******"");                    transport.sendMessage(message message.getRecipients(Message.RecipientType.TO));//发送邮件其中第二个参数是所有已设好的收件人地址                    transport.close();                    }catch(Exception ex){                    System.err.println(""邮件发送失败的原因是:""+ex.getMessage());                    System.err.println(""具体的错误原因"");                    ex.printStackTrace(System.err);                    }                }            }){            }.start();            Toast.makeText(getApplicationContext()发送成功""3000).show();        }    });}class PopupAuthenticator extends Authenticator{    private String username;    private String password;    public PopupAuthenticator(String usernameString pwd){    this.username=username;    this.password=pwd;}public PasswordAuthentication getPasswordAuthentication(){    return new PasswordAuthentication(this.usernamethis.password);    }}

解决方案五:
解决了吗?怎么解决的。

时间: 2025-01-01 12:05:46

extension-关于android里面发邮件的问题,下面是我运行时候的log,请各位帮我看一下。的相关文章

android,一个很简单的demo,一运行就出错,谁能帮我看看怎么回事。

问题描述 android,一个很简单的demo,一运行就出错,谁能帮我看看怎么回事. eclipse上也没有错误提示,怎么运行不了.安装好就提示停止运行. 文件 解决方案 看logcat的日志,或者进入调试模式运行,一步步调 解决方案二: 亲,绑定布局空间是要通过布局管理者来获取的,不然就是空指针错误.具体如下 解决方案三: 用调试模式调试吧,很方便的. 解决方案四: 要看log日志的啊.看日志才知道哪里出错了, 解决方案五: fragment控件初始化的问题吧 解决方案六: fragment控

Android调用系统的发邮件功能的小例子_Android

复制代码 代码如下: package com.example.myapi.email; import java.util.ArrayList;import java.util.List; import android.content.Context;import android.content.Intent;import android.net.Uri; public class SendEmailUtils {    private SendEmailUtils(){}    private

如何从我的android应用程序发邮件?

问题描述 如何从我的android应用程序发邮件? 我正在写一个android的应用程序.我怎么从它发邮件? 希望大家能够帮帮我~ 解决方案 最好的(最简单的)方法是用Intent Intent i = new Intent(Intent.ACTION_SEND);i.setType(""message/rfc822"");i.putExtra(Intent.EXTRA_EMAIL new String[]{""recipient@example

源码-android 编程如何发邮件??

问题描述 android 编程如何发邮件?? 找了好多源码照着写 结果都没能够成功发送邮件 我想实现的功能是静默发送邮件 求大神指点 解决方案 如果你看了很多代码都没有实现,那么很可能你的邮件服务商有问题,比如不支持你通过smtp协议发邮件,你的端口.用户名.密码等不正确,或者你的邮件被视作垃圾邮件而被拒绝发送. 建议你换一个邮件商,最好用付费的商业邮箱. 解决方案二: 你需要研究一下邮件协议:SMTP.POP3.IMAP4等

Android调用系统的发邮件功能的小例子

复制代码 代码如下:package com.example.myapi.email; import java.util.ArrayList;import java.util.List; import android.content.Context;import android.content.Intent;import android.net.Uri; public class SendEmailUtils {    private SendEmailUtils(){}    private s

在win2003上用cdo代替CDONTS发邮件

发邮件|发邮件 Introduction CDONTS was actually replaced by CDO already in Windows 2000 and Windows XP. But these Operating Systems supported CDONTS, and you could use CDONTS. Windows Server 2003 does not support CDONTS, and we are forced to use CDO. This t

功能强大的PHP发邮件类_php技巧

本文示例为大家分享了强大的PHP发邮件类,供大家参考,具体内容如下 <?php class smtp { var $smtp_port; var $time_out; var $host_name; var $log_file; var $relay_host; var $debug; var $auth; var $user; var $pass; var $sock; function smtp($relay_host = "", $smtp_port = 25,$auth

关于java mail 发邮件的问题总结(转)

今天项目中有需要用到java mail发送邮件的功能,在网上找到相关代码,代码如下: import java.io.IOException; import java.util.Properties; import javax.mail.Message; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.interne

协议-怎样做一个自动发邮件提醒的系统?

问题描述 怎样做一个自动发邮件提醒的系统? 我要做的是一个邮件通知系统,是为学校的学生做的.具体来说就是要追踪学生的学术状态,比如应该交作业的日期,在日期临近的时候自动发送一封提醒邮件,提醒学生按时交作业:如果没有按时交,再发送一封催促邮件.我想知道做这样的系统大概思路是怎样的,用什么语言比较合适?需要用到什么协议?是否需要自己写一个邮件服务器? 解决方案 不要邮件服务器,直接用现成的qq 163都可以.主流编程语言都支持,比如C# Java等,直接用smtp客户端类发,很简单的,具体googl