OutlookManager (Mail)
참고

1. 어셈블리 참조
2. Method : SendMail
받는 주소(toMails) 매개변수 예시
Example
Outlook 계정 등록
계정 선택 화면

프로필 등록








Last updated










Last updated
public static void SendMail(string[] toMails, string subject, string body, string[] attachmentPaths);
public static void SendMail(string toMails, string subject, string body, string[] attachmentPaths);string mails = "사용자1<first_user@mail.com>; 사용자2<second_user@mail.com>;";
string[] mails = new string[]
{
"사용자1<first_user@mail.com>",
"사용자2<second_user@mail.com>"
};private void SendMail()
{
// 사용자 정보에 등록된 전체 메일 주소
string query = @"
SELECT user_name + '<' + emp_email + '>' as mail
FROM sysUserMaster
WHERE emp_email <> ''
AND rtrchk <> 'Y'";
ResultSet result = ExecuteSql(query); // 구플) CommonExecuteSQL(query);
if ((result?.ResultDataSet?.Tables?.Count ?? 0) == 0)
{
return;
}
DataTable resultTable = result.ResultDataSet.Tables[0];
string[] mails = resultTable.Rows
.Cast<DataRow>()
.Select(x => x.GetValue("mail")?.ToString() ?? string.Empty)?
.ToArray() ?? new string[0];
try
{
WaitFormEx.Show(this); // 구플) ShowWaitForm(true);
OutlookManager.SendMail(mails, txtSubject.Text, txtBody.Text, null);
}
finally
{
WaitFormEx.Close(); // 구플) ShowWaitForm(false);
}
}