fetchMessageContents method

Future<MimeMessage> fetchMessageContents(
  1. MimeMessage message, {
  2. int? maxSize,
  3. bool markAsSeen = false,
  4. List<MediaToptype>? includedInlineTypes,
  5. Duration? responseTimeout,
})

Fetches the contents of the specified message.

This can be useful when you have specified an automatic download limit with downloadSizeLimit in the MailClient's constructor or when you have specified a fetchPreference in fetchMessages.

Optionally specify the maxSize in bytes to not download attachments of the message. The maxSize parameter is ignored over POP.

Optionally set markAsSeen to true in case the message should be flagged as \Seen if not already done.

Optionally specify includedInlineTypes to exclude parts with an inline disposition and a different media type than specified.

Optionally specify a specific responseTimeout until when the message contents must have arrived

Implementation

Future<MimeMessage> fetchMessageContents(
  MimeMessage message, {
  int? maxSize,
  bool markAsSeen = false,
  List<MediaToptype>? includedInlineTypes,
  Duration? responseTimeout,
}) {
  _incomingMailClient.log('fetch message contents of ${message.uid}');

  return _incomingLock.synchronized(
    () => _incomingMailClient.fetchMessageContents(
      message,
      maxSize: maxSize,
      markAsSeen: markAsSeen,
      includedInlineTypes: includedInlineTypes,
      responseTimeout: responseTimeout,
    ),
  );
}