MailAccount.fromManualSettingsWithAuth constructor
MailAccount.fromManualSettingsWithAuth({
- required String name,
- required String email,
- required String incomingHost,
- required String outgoingHost,
- required MailAuthentication auth,
- String userName = '',
- ServerType incomingType = ServerType.imap,
- ServerType outgoingType = ServerType.smtp,
- MailAuthentication? outgoingAuth,
- String outgoingClientDomain = 'enough.de',
- dynamic incomingPort = 993,
- dynamic outgoingPort = 465,
- SocketType incomingSocketType = SocketType.ssl,
- SocketType outgoingSocketType = SocketType.ssl,
- bool supportsPlusAliases = false,
- List<
MailAddress> aliases = const [],
Creates a mail account from manual settings with the specified auth.
You need to specify the account name, the associated email,
the incomingHost, outgoingHost and auth.
You can specify a different authentication for the outgoing server using
the outgoingAuth parameter.
You should specify the outgoingClientDomain for sending messages,
this defaults to enough.de.
The incomingType defaults to ServerType.imap, the incomingPort to
993 and the incomingSocketType to SocketType.ssl.
The outgoingType defaults to ServerType.smtp, the outgoingPort to
465 and the outgoingSocketType to SocketType.ssl.
Implementation
factory MailAccount.fromManualSettingsWithAuth({
required String name,
required String email,
required String incomingHost,
required String outgoingHost,
required MailAuthentication auth,
String userName = '',
ServerType incomingType = ServerType.imap,
ServerType outgoingType = ServerType.smtp,
MailAuthentication? outgoingAuth,
String outgoingClientDomain = 'enough.de',
incomingPort = 993,
outgoingPort = 465,
SocketType incomingSocketType = SocketType.ssl,
SocketType outgoingSocketType = SocketType.ssl,
bool supportsPlusAliases = false,
List<MailAddress> aliases = const [],
}) {
final incoming = MailServerConfig(
authentication: auth,
serverConfig: ServerConfig(
type: incomingType,
hostname: incomingHost,
port: incomingPort,
socketType: incomingSocketType,
authentication: auth.authentication,
usernameType: UsernameType.unknown,
),
);
final outgoing = MailServerConfig(
authentication: outgoingAuth ?? auth,
serverConfig: ServerConfig(
type: outgoingType,
hostname: outgoingHost,
port: outgoingPort,
socketType: outgoingSocketType,
authentication: auth.authentication,
usernameType: UsernameType.unknown,
),
);
return MailAccount(
name: name,
email: email,
incoming: incoming,
outgoing: outgoing,
userName: userName,
outgoingClientDomain: outgoingClientDomain,
supportsPlusAliases: supportsPlusAliases,
aliases: aliases,
);
}