发送电子邮件在谷歌玻璃 [英] Sending Email in Google Glass
问题描述
我想生成流媒体链接时发送电子邮件至(此时)硬盘codeD的电子邮件地址。我试图用被接纳为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
但是我收到一个错误说:
However I'm getting a error saying:
没有提供用于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" />
有没有人经历过这个问题?是否有此修补程序或为我从我的code发送电子邮件方式不同。
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.
希望有人能够帮助我。
推荐答案
我发现我的问题的解决方案。
我使用了其中的链接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
<一个href=\"http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.7-oth-JPR\"相对=nofollow>的JavaMail API 1.4.7
然后我代替我目前的mail.jar文件,一个在zip文件中找到。
我又跑了code,得到一个消息,说
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
请通过您的Web浏览器登录,然后再次尝试。
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.
我又跑到我的code,瞧我在我的收件箱有一个邮件。
I ran my code again and voila I got a mail in my inbox.
我希望其他人在此similair问题查找使用。
I hope other people with the similair problem find use in this.
这篇关于发送电子邮件在谷歌玻璃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!