안녕하세요. Outlook 추가 기능을 개발 중입니다. 작업 흐름의 일부로 mailItem
본문 및 제목을 사용해야하며 각받는 사람마다 메시지 본문을 변경해야합니다. 받는 사람 전자 메일로 보냅니다. Outlook MailItem 루프를 사용하여 여러 전자 메일 보내기
문제
은 단지 첫 번째 전자 메일을 보내는하고Send();
후에는 다른 수신자
Outlook.Application application = Globals.ThisAddIn.Application;
Outlook.Inspector inspector = application.ActiveInspector();
Outlook.MailItem myMailItem = (Outlook.MailItem)inspector.CurrentItem;
myMailItem.Save();
if (myMailItem != null)
{
myMailItem.Save();
PorceesData(myMailItem);
}
..
..
..
..
private void ProcessData(MailItem oMailItem)
{
Recipients recipients = oMailItem.Recipients;
string Body = oMailItem.Body;
string To = oMailItem.To;
string CC = oMailItem.CC;
string bcc = oMailItem.BCC;
foreach (Recipient r in recipients)
{
if (r.Resolve() == true)
{
string msg = "Hello open the attached file (msg.html);
string address = r.Address;
oMailItem.Body = msg;
oMailItem.To = address;
oMailItem.Subject = "my subject"
foreach (Attachment t in oMailItem.Attachments)
{
t.Delete();
}
oMailItem.Attachments.Add(@"mydirectory");
oMailItem.Send();
}
작성한 코드를 친절하게 보여주십시오. – Shai
코드 – user1067812
을 추가하고 게시했습니다. 'oMailItem.Recipients'를 통해 iterating하고 있습니다. 수신자 목록을 가져옵니다 ...? – Shai