SmtpClient: An extension to send emails using SMTP server

You should get error with password, if something is wrong.
Also read:

I've done it. To be sure, do I just need to enter the name of the application and paste the code it gives me?

Yes, that's the app-specific password.

A quick question, should I put the name of my application or the Mit A2 Companion?

@vknow360?

You can put any name

But later to still understand, for what exactly you once created that app specific password, it might be a good idea to use your app name

Taifun

Thank you!

Hello, I read above about the app password for gmail, and I have a couple of questions.

Do I use the app specific name from gmail in the username and the app password from gmail in the password?

Thank you. @vknow360

the username is your user name, for example mlapps@gmail.com
the password is the 16 digit app passcode

Taifun

Ah, thank you so much. Worked perfectly!

Hi
my app with the SmtpClient extension works fine on newer Android (9 and 12) but fails on 4.4.2.
Is there an email solution for the old Android 4.4.2 with the SSL protokoll?

Greetings
Thomas

Unfortunately I do not know, about which extension you are ttalking about, but you are invited to test my paid mail extension App Inventor Extensions: Mail | Pura Vida Apps here

https://play.google.com/apps/testing/appinventor.ai_taifunbaer.smtp

For Gmail accounts you need an application specific password, which you can get following these steps Sign in with app passwords - Google Account Help

Taifun

Well, i use the Smtp extention from "vknow360" and on Android 4.4.2 it crashes with the following screen.
Seems thats java.mail doesn't support the old android version. (on android >=9 everything is ok.)


9c040
Ididn't try your solution, but i think because both are based on the same java lib, the result should be the same.
Greetings
Thomas

I now moved your contribution into the correct thread

This is your decision
You also could try another of the many email solutions

Taifun

I am using the SMTP CLIENT extension to send notification emails using my SMTP server, and it works perfectly on the companion app, but when I export it to the apk, it doesn't work; the screen closes when I click “send.”

It works fine on the companion app, but not on the apk.

You can use logcat and try to find out what happens in apk

I’m getting a crash when calling my email-sharing function. The app throws:

java.util.ServiceConfigurationError: javax.mail.Provider: Provider com.sun.mail.imap.IMAPProvider not found
Caused by: ClassNotFoundException: com.sun.mail.imap.IMAPProvider

This happens when javax.mail.Session.getInstance() is created (Jakarta Mail 1.6.7 is logged). It looks like the extension package is missing the IMAP provider classes/resources (e.g., com.sun.mail.imap.IMAPProvider and/or the META-INF/services/javax.mail.Provider entries), so JavaMail fails while loading providers and crashes the app.

Which Android device and Android version are you using for your tests?
Does it work on another device?

Taifun

I tested it on different devices:

  • Galaxy A56 Android 15

  • Infinix Note 50 Android 15

  • Galaxy S24 Android 16

  • LDPlayer Emulator

  • Testing using ADB-Tool too

Which of the 2 versions are you using?

Try the version with dependencies
Taifun