kaisellgren / mailer

Compose and send emails from Dart. Supports file attachments, HTML emails and multiple transport methods.
MIT License
166 stars 86 forks source link

Sended email not showing in Sent folder of Sender #216

Closed moodstubos closed 2 years ago

moodstubos commented 2 years ago

strange, the message is sent correctly via SMTP but does not end up in the sent folder. I have never seen such behavior before. Is that a problem with this library?

final smtpServer = SmtpServer(emailServer, username: emailUsername, password: emailPassword);

final message = Message()
      ..from = Address(from, 'Sender')
      ..recipients.add(Address(to, 'Recipient'))
      ..subject = subject
      ..text = composeEmail
      ..attachments = attachments;

try {
      final SendReport sendReport = await send(message, smtpServer);
      print('Message sent: ' + sendReport.toString());
    } on MailerException catch (e) {
      print('Message not sent. ${e.message}');
      for (var p in e.problems) {
        print('Problem: ${p.code}: ${p.msg}');
      }
    }
close2 commented 2 years ago

SMTP is only the protocol for sending mails. Adding mails to a "sent mails" folder is done by other protocols (usually IMAP).

There is/was an attempt to merge SMTP and IMAP: JMAP. I don't know how successful this new protocol is.