1

send password by e-mail

hie everyone i am using e-mail feature on forget password.

it is possible onyly by javamail api ? or it could be done by intent method because i don't want to popup any email sending like Intent.action.sendto/mailto n all .. all i want is that get email id through edittext and then send password to it by email..

i don't want email checking feature that whether it exists or not.. what i want is just whether it exists or not just send the email if possible/exists.

i'm using through java mail api.. but not working for me..

your replies is appreciated.

thank you.

  • You should do some research before asking a question here. If you Google `android intent send email` you should get multiple results. One such example is shown below. – Lunchbox Apr 10 '14 at 08:15
  • and let me tell you i have google it first then write a query here... what u r answering is not what i asked.. first read the question before answering it.. – user3258080 Apr 10 '14 at 09:14
  • 1
    Asked before http://stackoverflow.com/questions/22970498/send-password-by-email . – martinstoeckli Apr 10 '14 at 09:33
  • Provide some code to show what you have tried. I don;t really get what you are asking without it. – Lunchbox Apr 10 '14 at 09:34
  • +1 for above link, that is probably what you are looking for – Lunchbox Apr 10 '14 at 09:35
  • yes i know it is asked before too.. but first have a look before posting comment it is also asked by me.. beacause i didn't got any reply.so i posted it again. – user3258080 Apr 10 '14 at 10:37
  • what i'm trying is http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a/2033124#2033124 – user3258080 Apr 10 '14 at 10:38
  • but it is not working for me.. so need a solution similar to above.. or any other solution similar to above.. i.e send email without UI – user3258080 Apr 10 '14 at 10:39
  • Actually it was a kind way to say, that one should not double post, try to improve your first question instead. And surely people will help more willingly if you don't shout at them, even if they don't hit your question they are trying to help. Finally you will get better answers if you can demonstrate what you already tried and what exactly didn't work. – martinstoeckli Apr 10 '14 at 10:55
  • okay forget about all. have you any solution for my problem.. i hope it is now explained in comments. – user3258080 Apr 10 '14 at 12:01

1 Answers1

1

I got this code from here.

public class Email extends Activity implements View.OnClickListener {

EditText personsEmail, intro, personsName, stupidThings, hatefulAction,
        outro;
String emailAdd, beginning, name, stupidAction, hatefulAct, out;
Button sendEmail;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.email);
    initializeVars();
    sendEmail.setOnClickListener(this);
}

private void initializeVars() {
    // TODO Auto-generated method stub
    personsEmail = (EditText) findViewById(R.id.etEmails);
    intro = (EditText) findViewById(R.id.etIntro);
    personsName = (EditText) findViewById(R.id.etName);
    stupidThings = (EditText) findViewById(R.id.etThings);
    hatefulAction = (EditText) findViewById(R.id.etAction);
    outro = (EditText) findViewById(R.id.etOutro);
    sendEmail = (Button) findViewById(R.id.bSentEmail);
}

public void onClick(View v) {
    // TODO Auto-generated method stub

    convertEditTextVarsIntoStringsAndYesThisIsAMethodWeCreated();
    String emailaddress[] = { emailAdd };
    String message = "Well hello "
            + name
            + " I just wanted to say "
            + beginning
            + ".  Not only that but I hate when you "
            + stupidAction
            + ", that just really makes me crazy.  I just want to make you "
            + hatefulAct
            + ".  Welp, thats all I wanted to chit-chatter about, oh and"
            + out
            + ".  Oh also if you get bored you should check out www.mybringback.com"
            + '\n' + "PS. I think I love you...   :(";

}

private void convertEditTextVarsIntoStringsAndYesThisIsAMethodWeCreated() {
    // TODO Auto-generated method stub
    emailAdd = personsEmail.getText().toString();
    beginning = intro.getText().toString();
    name = personsName.getText().toString();
    stupidAction = stupidThings.getText().toString();
    hatefulAct = hatefulAction.getText().toString();
    out = outro.getText().toString();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}

}
Lunchbox
  • 1,538
  • 2
  • 16
  • 42