How to Handle Password in Outlook without spying?

venkatvaradaraj

New Member
Hi All,

When the BOT is trying to read the emails, often i am getting a popup asking for credentials. So, I need to handle that popup using Credential manager or any other approach. Since i don't want to spy that popup and include the same in existing process.

Kindly suggest is there any way to handle this issue?

Thanks in Advance!
 
I suggest you to use the Business Object "Email - Exchanged Managed API" so you don need to spy on anything as there is a service to configure or you can write your own object and service with the below code

SetConfigurationParameters(UseWindowsCredentials, Username, Password, ExchangeEndpointURL);

to get mail details use the below:

InitExchangeService();
Attachments = new DataTable();
Attachments.Columns.Add("Name", typeof(string));
PropertySet messagePropSet = new PropertySet(BasePropertySet.FirstClassProperties);
messagePropSet.RequestedBodyType = BodyType.Text;

EmailMessage message = EmailMessage.Bind(service, messageID,messagePropSet);
noOfAttachments = message.Attachments.Count;

foreach (Attachment attachment in message.Attachments)
{
if (attachment is FileAttachment)
{
Attachments.Rows.Add(new Object[] { attachment.Name });
}
}
//noOfAttachments = Attachments.Rows.Count;
senderEmail =message.Sender.ToString();
messageBody= message.Body.ToString();
 
Top