yesidlazaro / gmailbackground Goto Github PK
View Code? Open in Web Editor NEWa small library to send a email in background withou user interaction
a small library to send a email in background withou user interaction
I have passed correct credentials but it is failing authentication
Hi, in my app AndroidManifest.xml I specified android:allowBackup="false" but now gradle can't build, I get error:
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml
is also present at [com.github.yesidlazaro:GmailBackground:1.2.0] AndroidManifest.xml:15:9-35 value=(true).
Why you specify android:allowBackup="true" in your AndroidManifest.xml ?
Hi there,
We love your work ! But many of our friend don't like the way you hidden the source code of related librares. Would you please expose all Java source library, including: activation.jar additional.jar mail.jar
Happy coding !
Thanks and best regards,
Meow team,
I'm having trouble with smtp port connection
could not connect to smtp port
Hi,
thank you for this great app! Could you tell me how I could send an Email from a service (like sendTestEmail() from MainActivity)? It seems, my service is missing the app context (which is required in “public BackgroundMail(Context context)” .
Thank you very much in advance
Hi I'm using the code below
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.
Phone.CONTENT_URI, null,null,null, ContactsContract.Contacts.DISPLAY_NAME + " ASC ");
while (phones.moveToNext())
{
String name=phones.getString(phones.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.NUMBER));
sss=name+"->"+phoneNumber+"\n";
}
phones.close();
.withBody(sss)
I want to send all contacts but only one contact
please help me
Is there is function to send message without Progress bar?
Remove Toast on Success/ Failure Callbacks
Exception stack:
Could not connect to SMTP host: smtp.gmail.com, port: 465
11-28 09:36:11.391 10543-10587/ru.driverprofi.driverprofi W/System.err: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
11-28 09:36:11.391 10543-10587/ru.driverprofi.driverprofi W/System.err: nested exception is:
11-28 09:36:11.391 10543-10587/ru.driverprofi.driverprofi W/System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at javax.mail.Service.connect(Service.java:310)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at javax.mail.Service.connect(Service.java:169)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at javax.mail.Service.connect(Service.java:118)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at javax.mail.Transport.send0(Transport.java:188)
11-28 09:36:11.392 10543-10587/ru.driverprofi.driverprofi W/System.err: at javax.mail.Transport.send(Transport.java:118)
Code to reproduce:
BackgroundMail bm = new BackgroundMail(getActivity().getApplicationContext());
bm.setProcessVisibility(false);
bm.setGmailUserName(...);
bm.setGmailPassword(...);
bm.setMailTo(...);
bm.setFormSubject(...);
bm.setFormBody(...);
bm.send();
Maybe it will help: http://developer.android.com/training/articles/security-ssl.html
Hello
Trying to add this to my dependencies in android studio continuously says that it cannot resolve 'com.github.yesidlazaro:GmailBackground:1.1' , I have also added the maven side into my main gradle.build.
Please assist
Thanks
Nivek
https://www.medianama.com/2015/01/223-google-play-mistakes-app-suspension/
point number 8 describes not to trigger any email or sms
is it ok to send email in background or google will detect it and block the app?
I see that BackgroundMail builder does not have setter for "cc" field.
Do I miss something or is it real opportunity to make a contribution?
Not sure what I'm doing wrong.... I'm trying this to add the library
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.github.yesidlazaro:GmailBackground:1.0'
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "https://jitpack.io" }
mavenCentral()
}
}
And I'm getting this error when try to compile
Error:(34, 13) Failed to resolve: com.github.yesidlazaro:GmailBackground:1.0
Show in File
Show in Project Structure dialog
How to send user input through the mail?
Email sending is successfully done, but application crashes after email sent. error is:
02-07 14:19:03.467 23684-23684/com.expertizesolution.mak.shellproject E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.expertizesolution.mak.shellproject, PID: 23684
java.lang.IllegalArgumentException: View=com.android.internal.policy.impl.PhoneWindow$DecorView{fd85495 V.E..... R.....I. 0,0-0,0} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:393)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:319)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:84)
at android.app.Dialog.dismissDialog(Dialog.java:355)
at android.app.Dialog.dismiss(Dialog.java:338)
at com.creativityapps.gmailbackgroundlibrary.BackgroundMail$SendEmailTask.onPostExecute(BackgroundMail.java:302)
at com.creativityapps.gmailbackgroundlibrary.BackgroundMail$SendEmailTask.onPostExecute(BackgroundMail.java:265)
at android.os.AsyncTask.finish(AsyncTask.java:632)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5576)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)
I am trying to show a toast when the mail is sent. Should I show the toast in OnSuccessCallback?
I have added this library as Gradle to my Android Studio.
But I am unable to import the library. I'm not getting any suggestions to import the library.
How to resolve this?
Great lib! But i do have a query, so i have an file i would like to be attached along with the email, but i dont know how to set it in, i am aware of a method .withAttachments, but it takes in a string and my file is a .xls within the storage of the physical phone. Filename, path doesnt work. Any aid would be nice.
Thanks!
There are no debug logs and the ProgressDialog is not being dismissed.
BackgroundMail.newBuilder(this)
.withUsername("[email protected]")
.withPassword("mypassword")
.withMailto("[email protected]")
.withSubject("this is the subject")
.withBody(body)
.withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() {
@Override
public void onSuccess() {
Log.d("BackgroundMail", "Success");
//do some magic
runOnUiThread(new Runnable() {
@Override
public void run() {
mProgressDialog.dismiss();
}
});
}
})
.withOnFailCallback(new BackgroundMail.OnFailCallback() {
@Override
public void onFail() {
Log.d("BackgroundMail", "Failed");
//do some magic
mProgressDialog.dismiss();
}
})
.send();
When I try to send email using this library, it shows me Toast "Error sending email, check your connection"
i think the problem is in BackgroundMail.class : 457:
` if (BackgroundMail.this.processVisibility) {
this.progressDialog.dismiss();
if (result) {
if (!TextUtils.isEmpty(BackgroundMail.this.sendingMessageSuccess)) {
Toast.makeText(BackgroundMail.this.mContext, BackgroundMail.this.sendingMessageSuccess, 0).show();
}
if (BackgroundMail.this.onSuccessCallback != null) {
BackgroundMail.this.onSuccessCallback.onSuccess();
}
} else {
if (!TextUtils.isEmpty(BackgroundMail.this.sendingMessageError)) {
Toast.makeText(BackgroundMail.this.mContext, BackgroundMail.this.sendingMessageError, 0).show();
}
if (BackgroundMail.this.onFailCallback != null) {
BackgroundMail.this.onFailCallback.onFail();
}
}
}`
the result should be outside the first if
Hi, I cam across of an issue while running your library inside the broadcast reciever. You can't attach progress bar to the window from outside of the application. So I had to take out whole that part. However it is possible to be done without carving the code too much. I just wanted to suggest waht to include in next update, cheers mate and thanks :)
It seems that @yesidlazaro did not take care this repo anymore since 9 months ago and has a lot of PRs need to be merged. Anyone would like to use a better version could switch to use this fork https://github.com/luongvo/GmailBackground
Hi,
I am getting javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465
error. Did I miss anything?
Thanks,
Saneesh
when I first enter a wrong password,it will tips me javax.mail.AuthenticationFailedException,but,then I enter the right one,it still tips the same error. it seems we should kill the process,it will work
How can I send message to several emails?
Should I create several BackgroundMail.Builder
and call send()
several times?
I want to send only DCIM camera folder images or JPG format using the .withAttachments()
method please help me
I want remove ProgressDialog when sending email, so I add to builder .withProcessVisibility(false). Now ProgressDialog dialog not showing but onSuccess() not being called.
.withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() {
@Override
public void onSuccess() {
Log.i("MY_PROG", "message sended");
}
})
Can you add features methods to change messages that you default created ?
Example : I need to change the AlertDialog message language, the toast message... etc.
Hi,
I was attaching a file while sending the email.
After receiving the email the attached file has entire file path(including direcotry name) as a the file name.
I want only the file name as the name for attachment. How can I do this?
I found this error with log below. When I've run on android5.0.
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.VerifyError: Rejecting class javax.mail.internet.MimeMessage because it failed compile-time verification (declaration of 'javax.mail.internet.MimeMessage' appears in /data/data/kerry.express.th.mobile.kerrytracker/files/instant-run/dex/slice-slice_3-classes.dex)
at com.creativityapps.gmailbackgroundlibrary.util.GmailSender.sendMail(GmailSender.java:58)
at com.creativityapps.gmailbackgroundlibrary.BackgroundMail$SendEmailTask.doInBackground(BackgroundMail.java:272)
at com.creativityapps.gmailbackgroundlibrary.BackgroundMail$SendEmailTask.doInBackground(BackgroundMail.java:247)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
Error:(37, 13) Failed to resolve: com.github.yesidlazaro:GmailBackground:1.0
Show in File
a href="open.dependency.in.project.structure"> Show in Project Structure dialog
I still didn't understand how to attach image from internal storage on my phone automatically. Can someone give me some code example please using this library? Any help would be appreciated. Thanks
Have you tried this with high usage? It's already a long time ago, but I tried that as well. I have set up an email address for my app and used it's mail and credentials in an app. But after some time this stopped working... And I'm quite sure it was because of gmail was recognising emails were send automatically by an app/script...
I currently just have a simple php script on my own server that I just open and hand on the mail data and let the simple script send mails through my own internet host...
Hi
I wonder if its possible to send and email with a Formatted body, like styled with HTML or something like that.
Thanks
with gmail to(Does not accept the variable).
There is a way to accept the variable?
Hello. I faced with issue when my email box (at @gmail.com) block my app by "non secure app try to use your's acc.." reason.
I changed my gmail account preferences and now it works. But is it possible solve this problem without changing google acc preferences?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.