2010-02-16 1 views
0

아래의 방법을 사용하여 비즈니스 기능 우편함으로 들어오는 메일에 회신합니다.Redemption을 사용하여 메일에 회신 할 때만 본문 텍스트가 간헐적으로 설정됩니다.

추가되는 본문 텍스트는 간헐적으로 만 설정됩니다. 이 방법은 누군가가 메일 링에서 탈퇴하기 위해 이메일을 보내었지만 발신자 (또는 본문)의 이메일 주소가 데이터베이스에서 발견되지 않았을 때만 호출되며 원하는 메일 주소를 보내달라고 요청합니다 탈퇴

private void replyToMail(OutlookItem item) 
     { 
      RDOSession session = new RDOSession(); 
      session.Logon(null, null, null, true, null, null); 
      RDOMail thisItem = session.GetMessageFromID(item.EntryID, item.StoreID, null); 
      RDOMail reply = thisItem.Reply(); 

      RDOAddressEntry optingout = session.AddressBook.GAL.ResolveName("optingout"); 
      //reply.Sender = optingout; this had no effect 
      reply.SentOnBehalfOf = optingout; 
      reply.Subject = "Automated Response - Could not complete unsubscribe"; 
      reply.Body = "This is an automated response from the Newsletter unsubscribe system. We couldn't find "+item.Sender+" in our database to unsubscribe you from our mailings.\r\n\r\nPlease reply to this mail and include the email address you want to unsubscribe.\r\n\r\nKind Regards\r\n."; 
      reply.Send(); 

      session.Logoff(); 
     } 

답변

0

나는 thingie.HTMLBody와 thingie.Body를 편집해야했습니다.

나는 각각의 값을 설정하는 방법을 알아낼 수 있다고 생각하지만이 인스턴스에서 본문을 제어한다는 것을 확신하기 때문에 둘 다 설정하는 것뿐입니다.

0

먼저 OOM을 사용하는 경우 RDOSession.Logon을 호출 할 이유가 없습니다. 간단하게 MAPIOBJECT 속성을 지정하면됩니다. session.Logon() 줄을 session.MAPIOBJECT = item.Application.Session.MAPIOBJECT 으로 바꿉니다. 이 아닌 로그 오프를 호출하십시오.

두 번째로 메시지가 본문없이 수신 되었습니까? 보낸 편지함 폴더에 빈 상자가 보입니까?

+0

전달되는 OutlookItem 유형은 소프트웨어에서 사용되는 사용자 지정 클래스입니다. 명확성 부족에 사과드립니다. 수신 된 메일에는 답장을 보내고 아무것도 입력하지 않고 보내면 예상대로 본문이 있습니다. 즉, Reply.Body에 대한 나의 전화 = "..."; 아무런 효과가 없습니다. –