ما الخطأ في الكود

Intent email = new Intent(Intent.ACTION_SEND);

    email.putExtra(Intent.EXTRA_EMAIL , new String[] {"myemail"});
    email.putExtra(Intent.EXTRA_SUBJECT,"Hello");
    email.putExtra(Intent.EXTRA_TEXT , my);
    email.setType("mesage/rfc822");
    startActivity(Intent.createChooser(email,"myemail"));

التعليق السابق

وهذا الكود الجديد

public class MainActivity extends AppCompatActivity {

private String editTextEmail;
private String editTextSubject;
private String editTextMessage;
private Session session;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
public void po(View view){
    Properties props = new Properties();
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.socketFactory.port", "465");
    props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.port", "465");
    session = Session.getDefaultInstance(props,
            new javax.mail.Authenticator() {
                //Authenticating the password
                protected PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication("my email", "passs");
                }
            });
    try {
        //Creating MimeMessage object
        MimeMessage mm = new MimeMessage(session);

        //Setting sender address
        mm.setFrom(new InternetAddress("my eamail"));
        //Adding receiver
        mm.addRecipient(Message.RecipientType.TO, new InternetAddress("to email"));
        //Adding subject
        mm.setSubject("Heloo ");
        //Adding message
        mm.setText("jabour");

        //Sending email
        Transport.send(mm);

    } catch (MessagingException e) {
        e.printStackTrace();
    },