Browse Source

Fixed saving without from address

main
M66B 6 years ago
parent
commit
0aa32d7402
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      app/src/main/java/eu/faircode/email/MessageHelper.java

+ 5
- 2
app/src/main/java/eu/faircode/email/MessageHelper.java View File

@ -85,8 +85,11 @@ public class MessageHelper {
static MimeMessage from(EntityMessage message, Session isession) throws MessagingException {
MimeMessage imessage = new MimeMessage(isession);
if (message.from != null)
imessage.setFrom(MessageHelper.decodeAddresses(message.from)[0]);
if (message.from != null) {
Address[] from = MessageHelper.decodeAddresses(message.from);
if (from.length > 0)
imessage.setFrom(from[0]);
}
if (message.to != null)
imessage.setRecipients(Message.RecipientType.TO, MessageHelper.decodeAddresses(message.to));


Loading…
Cancel
Save