Mail

Server Configuration

WithSMTPServerName and WithSMTPPortNum configure the outgoing mail server (default port 465). WithIMAPServerName and WithIMAPPortNum configure IMAP for receiving email (default port 993). WithPOPServerName and WithPOPPortNum configure POP3 for receiving email (default port 110). WithUserName and WithPassword set the authentication credentials. WithFromName sets the display name that appears as the sender. LoadSettings() and SaveSettings() load and save all server settings to a file. With no argument both use ./GPALMail.yaml as the default path. Pass a GPALFile to redirect to a different path -- that path becomes the in-session default so subsequent no-arg calls use it automatically.

Examples

GPAL Fluent: High-level fluent C# API

//SaveSettings() and LoadSettings() persist and restore all server connection settings. With no argument both use ./GPALMail.yaml. Passing a GPALFile sets that path as the session default -- subsequent no-arg calls use it for the rest of the run.

// Save server settings to the default path (./GPALMail.yaml)

GPAL.Mail

.WithSMTPServerName("smtp.example.com")

.WithSMTPPortNum(587)

.WithUserName("sender@example.com")

.WithPassword("app-password")

.WithFromName("GPAL Automation")

.SaveSettings();


// Redirect to a custom path -- becomes the session default

GPAL.Mail.SaveSettings(GPAL.File.WithFileName("config/mail.yaml"));


// Load from the session-default path (no arg needed after redirect)

GPAL.Mail.LoadSettings();


// Or load and redirect in one call

GPAL.Mail.LoadSettings(GPAL.File.WithFileName("config/mail.yaml"));

💬 Ask GPAL