2
votes

I have created Outlook add ins which create reply on incoming email based on some rule specified by user.

but i am getting one problem which describe as, when i create reply with outlook mailitem it dosent include from,sent,to,subject in body from incoming email like when we click reply button in outlook as shown in image enter image description here

Here is my code which is creating reply for incoming email.

void mailreply(Outlook.MailItem Email)
{
   Outlook.MailItem replyMail = null;
   replyMail = IncomingEmail.Reply(); 
   replyMail.subject = "Abcd"
   replyMail.body = "XYZ";

    --------- rest of code -------
   replyMail.send();
 }

please help me to solve this problem, how can i add Incoming email datetime and from,sent etc to reply body.

thanks in advance

2

2 Answers

1
votes

I got the solution, i am posting here if any one have same issue then they can refer this post

void mailreply(Outlook.MailItem Email)
{
   Outlook.MailItem replyMail = null;
   replyMail = IncomingEmail.Reply(); 
   replyMail.subject = "Abcd"
   replyMail.body = "XYZ";

  //Answer bellow
   replyMail.To = Email.FromAddress;
   replyMail.ReceveDateTime = Email.SentDateTime; 
    --------- rest of code -------
   replyMail.send();
 }
-1
votes

You should expand your code to place these lines in replyMail.body