MailAccount.fromDiscoveredSettings constructor
MailAccount.fromDiscoveredSettings({
- required String name,
- required String email,
- required String password,
- required ClientConfig config,
- required String userName,
- String outgoingClientDomain = 'enough.de',
- String? loginName,
- bool supportsPlusAliases = false,
- List<
MailAddress> aliases = const [],
Creates a mail account with the given name for the specified email
from the discovered config with a a plain authentication for the
preferred incoming and preferred outgoing server.
You nee to specify the password.
Specify the userName if it cannot be deducted from the email
or the discovery config.
For SMTP usage you also should define the outgoingClientDomain,
which defaults to enough.de.
Implementation
factory MailAccount.fromDiscoveredSettings({
required String name,
required String email,
required String password,
required ClientConfig config,
required String userName,
String outgoingClientDomain = 'enough.de',
String? loginName,
bool supportsPlusAliases = false,
List<MailAddress> aliases = const [],
}) =>
MailAccount.fromDiscoveredSettingsWithAuth(
name: name,
email: email,
userName: userName,
auth: PlainAuthentication(
loginName ??
getLoginName(
email,
config.preferredIncomingServer.toValueOrThrow(
'no preferred incoming server found',
),
),
password,
),
config: config,
outgoingClientDomain: outgoingClientDomain,
supportsPlusAliases: supportsPlusAliases,
aliases: aliases,
);