When users register with my application, I want my application to automatically send some verification code to user email. I will generate verification code, but i don't know how to automatically send it to user email.
Give me some solution guys!!
NOTE!!!!!!!
I am not asking how to send email to someone which is like choosing email app and it populates subject and body in the application.
Then you have to use web services. when user register with your app, you store user registration information in server database. while inserting user record in database insert verification code in one column. (write a code to generate verification code in web service it self.) after successful inserting row in database. you can easily pick email and verification code. Now you have all details of user. Write a code in web service to send verification code in email to user.
Normally its done from the server side. Generating authentication token and sending it to a mail address using an SMTP server. for example mail in php.
If you really want to do it on android side which doesnt open any application and directly sends a mail to gmail, here is an alternative I could find.
Sending Email in Android using JavaMail API without using the default/built-in app
firebase email verification is the best to verify the email without using any custom created service (API)
Related
I am developing an app wherein the users use either email and phone to perform registration.
Users can enter their email or phone for log in, I want the same OTP to be sent to mobile and email simultaneously. Please Help!
If you want to work only with Firebase Authentication, then there is not any suitable solution that meets your requirement.
Some limitations you can find with Firebase are Firebase Authentication Limits and Phone number sign-in limits.
However the alternative solution is using third-party SMS gateway. through with you can send OTP to phone number as well as to email also simultaneously.
Lets assume you already have mechanism to generate OTP and verify OTP from android app.
Now the problem is how to send OTP to the user's email.
One of solution is using MailGun service to send email from your backend.
Also, if you want to templating your email, you can use library called handlebar
I am developing and android app that uses google Firebase as an authentication provider.I searched out a lot but can not find appropriate answer.I want to send custom Welcome email to user when he/she sign up for the first time.Like the email contain simple "Welcome to Our service Hope you would enjoy our service etc.
Any One have any idea would be appreciated and thank in advanced.
My question is not about how to send the email from phone using intent service but i want to send the email in background without opening any email sending dialog just like email service from amazon that contain info about their service or products.i just want to send email once when the user sign up in firebase for the first time.
You need to use Firebase Cloud Function !
This sample will help you.
With Firebase Cloud Function you can add a trigger on the user account creation and send him a welcome email.
Other sample here.
you can use NodeJs with nodemailer link and check this tutorial or a little trick if you will not use the reset password option, go to firebase console> authentication > templates, for the email verification you can not change the template but for the password reset you can change it with the body you wants. After your user sign in use auth.sendPasswordResetEmail(email) to send the email, nothing will happens to the account and you still have access on it.
I am trying having a little bit of a problem in my application which uses firebase to store usernames and send verification emails. I have gotten to the point where you can create an account and it will send a verification link. So, I was wondering since if someone registers with an email firebase automatically registers it, so can't a person that just type a random email, say for example test#test.com and then the real owner of test#test.com tries registering but can't because the email is already taken even though the imposter didn't/can't verify it the verification link. Is there any way to make it so that the email is only registered in the firebase auth once the verification link has successfully been clicked by the person that really owns that email?
Any help would be greatly appreciated! (Also I am very new to firebase)
Here is my Java class code:
https://pastebin.com/HP7Q15Gh
When you send the email verification, it won't be verified until the link is clicked, so even if User A tries to verify UserB#example.com, it will send the link, but won't create the account until the email is verified. If User B tries to create an account, another email would be sent to UserB#example.com, which they could verify. The template very clearly says:
If you didn’t ask to verify this address, you can ignore this email.
This would allow the "real" user to create an account with their own address if the wanted to.
If you want to end-to-end test email verification try EmailE2E.com — it's free.
You can send and receive emails from randomly generated inboxes via an API.
It's perfect for testing Firebase, Amazon Cognito, or other OAuth providers that use email verification codes during sign up. Plus it has clients in Java and JS.
I am trying to send mail in background using the method provided in the accepted answer of This Question. Earlier the mails were sending easily. But due to new gmail's 2-step verification, the I am not able to send mail from email id having this feature. Please suggest any method or change in the code by which I can send mail through the mail id having the 2-step verification.
Thanks.
With 2 Step security, you will need to generate an application specific password, and use that from your app.
This Link will bring you to the creation page for new application specific passwords.
In my requirement i need to send a mail directly when user click on the send button without using intents.I have done it with java mail API.But it ask password.Can i send without giving my password?. Is it possible with any other ways? Please tell me.I used bellow link for sending mail.
http://androidcodeexamples.blogspot.in/2012/05/android-send-email-via-gmail-actually.html
Thanking in Advance.
To answer your question I first ask you one.. Can you send mail with any of the available acount without logging in with your password? the answer is no. Because before sending mail you need to authenticate your acount with password. So this is must. If you can send mail without password then anybody can do the same which is definitely not wanted.
Can i send without giving my password?
Your mail server administrator is unlikely to allow password-less email sending, as soon a billion spammers will use your mail server.
You are welcome to write a Web service that will send email to your dedicated "contact-us" account. Or, have the Web service store the "contact-us" information elsewhere, such as a database.
You need to to authenticate to send mails. If you device already has applications you can use intents which will allow you the user to make a choice to sent mails using the desired application.
To send mails using intents
http://www.mkyong.com/android/how-to-send-email-in-android/
You can also hard code username and password and sent mails using javamail api.
Sending Email in Android using JavaMail API without using the default/built-in app
The above requires users to have gmail account.