0
画像をメールで送信します。今私はギャラリーから画像を選択していますが、エミュレータで表示されていますが、メールに同じ画像を送信する必要があります。ギャラリーから画像を選択していますが、同じ画像をアンドロイドでメールに送信したい
マイコード最後の引数は、画像ここ
new SendMailTask(Main2Activity.this).execute("[email protected]",
"unixxxxx", toEmails, "Testing", mbody, ???);//i don't know last argument how to send
のためであるとして...私は値を渡した....
主な活動
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == SELECT_PICTURE) {
// Get the url from data
Uri selectedImageUri = data.getData();
if (null != selectedImageUri) {
// Get the path from the Uri
String path = getPathFromURI(selectedImageUri);
Log.i(TAG, "Image Path : " + path);
// Set the image in ImageView
iv.setImageURI(selectedImageUri);
}
}
}
}
です私は表示する必要があります...
0事前にのpublic MimeMessage createEmailMessage() throws AddressException,
MessagingException, UnsupportedEncodingException {
mailSession = Session.getDefaultInstance(emailProperties, null);
emailMessage = new MimeMessage(mailSession);
emailMessage.setFrom(new InternetAddress(fromEmail, fromEmail));
Log.i("GMail","toEmail: "+toEmailList);
emailMessage.addRecipient(Message.RecipientType.TO,
new InternetAddress(toEmailList));
emailMessage.setSubject(emailSubject);
emailMessage.setContent(emailBody+,"text/html");// Here I have to display
// emailMessage.setText(emailBody);// for a text email
Log.i("GMail", "Email Message created.");
return emailMessage;
}
おかげで...
私は意図 –
せずにメールを送信するSMTPを使って意図せずに電子メールを送信するには次のリンクを参照してください。http://stackoverflow.com/a/25136400/6800209 –