Skip to content

Commit

Permalink
intent type text plain
Browse files Browse the repository at this point in the history
  • Loading branch information
ttpro1995 committed Sep 14, 2015
1 parent 7c04e63 commit f9bb067
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ private void mailFromAssets(){
is = assetManager.open("winter_is_coming.jpg");
CreateTempFile tempFile = new CreateTempFile("winter_is_coming.jpg",is,MainActivity.this);
File file = tempFile.getFile();
Mailer mailer = new Mailer(this);
mailer.sendMail("[email protected]","winter_is_coming","meow meow",file);

Mailer.send(MainActivity.this,"[email protected]", "winter_is_coming", "meow meow", file);
}catch (IOException e){
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import android.support.annotation.Nullable;
import android.util.Log;

import org.apache.http.protocol.HTTP;



import java.io.File;

Expand All @@ -25,7 +26,7 @@ public void sendMail(String to,String subject, String msg,@Nullable File file1){
Intent emailIntent = new Intent(Intent.ACTION_SEND);

// The intent does not have a URI, so declare the "text/plain" MIME type
emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{to}); // recipients
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, msg);
Expand All @@ -40,7 +41,7 @@ public static void send(Context context,String to,String subject, String msg,@Nu
Intent emailIntent = new Intent(Intent.ACTION_SEND);

// The intent does not have a URI, so declare the "text/plain" MIME type
emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{to}); // recipients
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, msg);
Expand Down

0 comments on commit f9bb067

Please sign in to comment.