Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this code.</p> <pre><code>public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button login = (Button) findViewById(R.id.mBtnSubmit); login.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { 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 = Session.getDefaultInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("dipakkeshariya@android.com", "dipakkeshariya"); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress("dipak.keshariya@android.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("dipak.keshariya@mobileappdeveloper.com")); message.setSubject("Testing Subject"); message.setContent("Hi Dipak Keshariya (Android Developer)", "text/html; charset=utf-8"); Transport.send(message); } catch (MessagingException e) { throw new RuntimeException(e); } } }); } } </code></pre> <p>And see below link for more information.</p> <p><a href="http://androidcodeexamples.blogspot.in/2012/05/android-send-email-via-gmail-actually.html" rel="nofollow">Android – Send Email Via GMail (Actually Via SMTP)</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload