在Google Glass中发送电子邮件 [英] Sending Email in Google Glass

查看:512
本文介绍了在Google Glass中发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当生成流式链接时,我正在尝试发送一封电子邮件(在这一刻)硬编码的电子邮件地址。我尝试使用被接受为awnser的代码 HERE

I'm trying to send a email to a (at this moment) hardcoded email adress when a streaming link is generated. I tried using the piece of code that was accepted as awnser HERE

但是我收到一条错误:


没有提供者smtp

No provider for smtp

有没有人有什么线索可能导致这个?
我将所需的.jar文件拖到我的libs文件夹中。在我的gradle.build文件中,我添加了他们编译

does anyone have a clue on what could be causing this? I dragged the needed .jar files into my libs folder. In my gradle.build file I added them to be compiled

compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')

在我的settings.gradle文件中我添加了

In my settings.gradle file I added

include ':libs:activation.jar'
include ':libs:additionnal.jar'
include ':libs:mail.jar'

如果涉及权限,我的清单看起来就像这样。

My manifest looks like this when it comes to permissions

<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

有没有人经历过这个问题?有没有一个修复这个或不同的方式,我从我的代码发送电子邮件。

has anyone experienced this problem before? Is there a fix for this or a different way for me to send a email from my code.

希望有人能够帮助我这个。

Hope someone is able to help me with this.

推荐答案

我找到了解决问题的解决方案。
我正在使用在awnser中链接的jar文件。但是,似乎mail.jar文件已经过时,或者无法正常工作。

I found a solution for my problem. I was using the jar files that where linked in the awnser. However it seems that mail.jar file is outdated or just not working properly.

我下载了以下mail.jar

I downloaded the following mail.jar

JavaMail API 1.4.7

然后我用zip文件中找到的mail.jar文件替换了我当前的。
我再次运行代码,并收到一条消息说

Then I replaced my current mail.jar file with the one found in the zip file. I ran the code again and got a message saying


请通过您的网络浏览器登录,然后重试。 p>

Please log in via your web browser and then try again.

然后我去了我的谷歌安全设置和访问较不安全的应用程序。

I then went to my google security settings and "Access for less secure apps" was on.

我再次运行我的代码,瞧我的收件箱中有一封邮件

I ran my code again and voila I got a mail in my inbox.

我希望有其他有同型恋体系的人在这个问题上可以使用。

I hope other people with the similair problem find use in this.

这篇关于在Google Glass中发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆