email - Custom Domain Mail in Android -
Hello friends, I want to configure mail settings in Android .. When I search for it on the internet, I only want to Only G-Mail could send through, how can I send mail to custom domain e, g: someone@example.com If this is possible please reply as soon as possible
Import android.net.Uri; Importroid.os.Bundle; Import android App Import android.content.Intent; Import android.view.Menu; Import android.view.View; Import android.widget.Button; Import android.widget.EditText; Import android.widget.Toast; Public class enhances main activity activity (personal editorial reader recipients, subject, body; @ override protected form zero (bundle saved instenstate) {super.naught (savedinstenstate); setContentView (R.layout.activity_main); recipient = (Edit Text) Search ViewById (R.id.receiptent); Subject = (Edit Text) VVBIID (R. Id); Body = (EditText) findViewById (R.id.body); Button sendBtn = (Button Find FindById (R.id.sendEmail); sendBtn.setOnClickListener (New View. OnClickListener () {public void onClick} {sendEmail (); recipient .set text (""); subject.setText (""); body.setText ("");}});} Secure Zero Send email ( ) {String [] Recipients = {Recipient .gettext (). ToString ()}; Intent Email = New Intention (Intent.ACTION_SEND, Uri. PRSE ("Melto:"); email.setType ("Message / RFC822") ; Email.putExtra (Intent.EXTRA_EMAIL, recipient); Email.putExtra (Intent.EXTRA_SUBJECT, subject.getText (). ToString ()); Email.putExtra (Intent.EXTRA_TEXT, body.getText () ToString ()); {StartActivity (Try Intent.createChooser (Email, "Choose an Email Client ..."); } Hold (android.content.ActivityNotFoundException ex) {toast. Maketext (Main activation. This, "no email client is installed.", Toast. LNNGGLOG). Show (); }} @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Increase Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fulao (R. menu menu, menu); Back true; }}
Using Action_send intent, the user chooses to send mail. So if you only have G-Mail configured on your test device, then you can only send via G-Mail.
Setting up a mail app that has an action_send intent-filter, such as an email from someone@example.com, will add this mail app to the options of intent.
If you want to choose an account and send it to the mail program, then I think you have to use an API such as JavaMail.
Comments
Post a Comment