Venkatarao Dadi
Venkatarao Dadi

Reputation: 96

In python when I use 'Reply' function for outlook mail item the previous conversation is not appending

I am using python 3.7.0

Eg:-

  1. Person 'A' sent mail to me with text :- "Test mail".
  2. Person 'B' received the mail and replied with body :- "Thanks for the information. Please attach logs"
  3. Person 'A' received the mail with new body message mentioned in step-2. The body message mentioned in step-1 is not appearing in the mail.
import win32com.client

outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox=outlook.GetDefaultFolder(6)
messages=inbox.items
msg=messages.GetLast()

reply=msg.Reply()
reply.Body = "Thanks for the information. Please attach logs"
reply.Send

Upvotes: 2

Views: 1082

Answers (1)

KevinST
KevinST

Reputation: 31

Here is how you can replay the mail and keep previous conversations:

    reply.Body = "Thanks for the information. Please attach logs" + reply.Body
    reply.Send()

Upvotes: 1

Related Questions