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.

Community
  • 1
  • 1
NoSixties
  • 2,443
  • 2
  • 28
  • 65

1 Answers1

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.

NoSixties
  • 2,443
  • 2
  • 28
  • 65
  • JavaMail 1.4.7 is pretty old. The current version is [JavaMail 1.5.2](https://java.net/projects/javamail/pages/Home). – Bill Shannon Feb 24 '15 at 19:07
  • @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 great – NoSixties Feb 25 '15 at 08:17