Class EmailConfig.Builder
java.lang.Object
cloud.opencode.base.email.EmailConfig.Builder
- Enclosing class:
EmailConfig
Email Configuration Builder
邮件配置构建器
- Since:
- JDK 25, opencode-base-email V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the configuration 构建配置connectionTimeout(Duration timeout) Set connection timeout 设置连接超时debug(boolean debug) Enable debug mode 启用调试模式defaultFrom(String from) Set default sender email 设置默认发件人邮箱defaultFrom(String from, String name) Set default sender email with display name 设置默认发件人邮箱和显示名称dkim(DkimConfig dkim) Set DKIM signing configuration 设置DKIM签名配置Set SMTP host 设置SMTP主机maxRetries(int retries) Set max retry attempts 设置最大重试次数oauth2Token(String oauth2Token) Set OAuth2 access token for XOAUTH2 authentication 设置OAuth2访问令牌用于XOAUTH2认证Set password for authentication 设置认证密码poolIdleTimeout(Duration timeout) Set pool idle timeout (reserved for future use) 设置连接池空闲超时(保留供将来使用)poolSize(int size) Set connection pool size (reserved for future use) 设置连接池大小(保留供将来使用)port(int port) Set SMTP port 设置SMTP端口ssl(boolean ssl) Enable SSL connection 启用SSL连接starttls(boolean starttls) Enable STARTTLS 启用STARTTLSSet send timeout 设置发送超时Set username for authentication 设置认证用户名
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
host
Set SMTP host 设置SMTP主机- Parameters:
host- the SMTP host | SMTP主机- Returns:
- this builder | 构建器
-
port
Set SMTP port 设置SMTP端口- Parameters:
port- the SMTP port | SMTP端口- Returns:
- this builder | 构建器
-
username
Set username for authentication 设置认证用户名- Parameters:
username- the username | 用户名- Returns:
- this builder | 构建器
-
password
Set password for authentication 设置认证密码- Parameters:
password- the password | 密码- Returns:
- this builder | 构建器
-
oauth2Token
Set OAuth2 access token for XOAUTH2 authentication 设置OAuth2访问令牌用于XOAUTH2认证Used for Gmail, Outlook and other OAuth2-enabled mail servers.
用于Gmail、Outlook和其他支持OAuth2的邮件服务器。
- Parameters:
oauth2Token- the OAuth2 access token | OAuth2访问令牌- Returns:
- this builder | 构建器
-
ssl
Enable SSL connection 启用SSL连接- Parameters:
ssl- true to enable SSL | true启用SSL- Returns:
- this builder | 构建器
-
starttls
Enable STARTTLS 启用STARTTLS- Parameters:
starttls- true to enable STARTTLS | true启用STARTTLS- Returns:
- this builder | 构建器
-
defaultFrom
Set default sender email 设置默认发件人邮箱- Parameters:
from- the default sender email | 默认发件人邮箱- Returns:
- this builder | 构建器
-
defaultFrom
Set default sender email with display name 设置默认发件人邮箱和显示名称- Parameters:
from- the default sender email | 默认发件人邮箱name- the display name | 显示名称- Returns:
- this builder | 构建器
-
timeout
Set send timeout 设置发送超时- Parameters:
timeout- the timeout duration | 超时时长- Returns:
- this builder | 构建器
-
connectionTimeout
Set connection timeout 设置连接超时- Parameters:
timeout- the timeout duration | 超时时长- Returns:
- this builder | 构建器
-
maxRetries
Set max retry attempts 设置最大重试次数- Parameters:
retries- the max retries | 最大重试次数- Returns:
- this builder | 构建器
-
poolSize
Set connection pool size (reserved for future use) 设置连接池大小(保留供将来使用)Note: Connection pooling is not implemented in the current version. This setting is reserved for future enhancements.
注意:当前版本未实现连接池。此设置保留供将来增强使用。
- Parameters:
size- the pool size | 连接池大小- Returns:
- this builder | 构建器
-
poolIdleTimeout
Set pool idle timeout (reserved for future use) 设置连接池空闲超时(保留供将来使用)Note: Connection pooling is not implemented in the current version. This setting is reserved for future enhancements.
注意:当前版本未实现连接池。此设置保留供将来增强使用。
- Parameters:
timeout- the idle timeout | 空闲超时- Returns:
- this builder | 构建器
-
debug
Enable debug mode 启用调试模式- Parameters:
debug- true to enable debug | true启用调试- Returns:
- this builder | 构建器
-
dkim
Set DKIM signing configuration 设置DKIM签名配置- Parameters:
dkim- the DKIM configuration | DKIM配置- Returns:
- this builder | 构建器
-
build
-