Mobile app Service (mail)

Source: Internet
Author: User
Tags app service

Article Source: Original

1. Plain Text send:

Using this method will call other mail sender, the equivalent of clicking on the system of the Mail app or other mail client (QQ, Gmail, NetEase, etc.)

 Public void SendEmail (string title, string content) {    new  Intent (Intent.  Action_sendto);    Email.setdata (Uri.parse ("Mailto:[email protected]");    Email.putextra (Intent.extra_subject, title);    Email.putextra (intent.extra_text, content);    StartActivity (intent.createchooser email, "Please select the Mail sender!") "));}

2. Send with Attachment:

   Public voidsendemailwithattachment (string title, string content, File attachment) {Intent email=NewIntent (intent.action_send); String[] Emailaddrs=Newstring[]{"[Email protected]", "[email protected]"}; Email.settype ("Application/octet-stream");//---Set message type: With attachmentsEmail.putextra (Intent.extra_email, Emailaddrs);        Email.putextra (Intent.extra_subject, title);        Email.putextra (intent.extra_text, content);                Email.putextra (Intent.extra_stream, Uri.fromfile (attachment)); StartActivity (intent.createchooser (email,"Please select Mail sender!")); }

Mobile app Service (mail)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.