Sending Email in Google Glass
Asked Answered
P

1

0

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:

No provider for smtp

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')

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.

Pocahontas answered 24/2, 2015 at 10:28 Comment(0)
P
0

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.

I downloaded the following mail.jar

JavaMail API 1.4.7

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

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.

Pocahontas answered 24/2, 2015 at 12:25 Comment(2)
JavaMail 1.4.7 is pretty old. The current version is JavaMail 1.5.2.Dextrosinistral
@BillShannon I didnt see it on the oracle page so that's why I didnt grab it. Didn't look further then that really cause it worked. But I just tested the 1.5.2 one you linked and with that it still works greatPocahontas

© 2022 - 2024 — McMap. All rights reserved.