EmailHelperSendAsync(ListMailAddress, String, String) Method

非同步發送郵件

Definition

Namespace: eBizprise.Framework
Assembly: eBizprise.Framework.EmailHelper (in eBizprise.Framework.EmailHelper.dll) Version: 25.0.1.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
C#
public Task<bool> SendAsync(
	List<MailAddress> emails,
	string subject,
	string message
)

Parameters

emails  ListMailAddress
收件人
subject  String
主旨
message  String
內文

Return Value

TaskBoolean
bool

Example

C#
EmailHelper emailHelper = new EmailHelper(new EmailConfiguration()
{
    DisplayMailAddress = "test@ebizprise.com",
    DisplayName = "test",
    IsSsl = true,
    Port = 587,
    Server = "mail.ebizprise.com",
    SecurityCode = "password",
    Username = "account",
    IsSelfSign = true
});
Assert.IsNotNull(emailHelper, "郵件助手初始化失敗");

List<MailAddress> to = new List<MailAddress>() { new MailAddress("test1@ebizprise.com", "test1") };

Task<bool> task = Task<bool>.Run(async () => await emailHelper.SendAsync(to, "非同步Email測試信件", "非同步Email測試內文"));
bool isSuccess = task.Result;

Revision History

DateVersionDescription
2021/03/241.0.0.0初版
2025/09/1925.0.0.0彙整2025年度初版

See Also