Connect to Outlook Live with Outlook

1 – Add a new Account

image

2 – Provide your E-mail and Password

image

3 – Wait until Outlook looks for you Credentials

image

4 – Confirmation Box, you have to restart Outlook at this point

image

5 – When Outlook restart, provide your credentials

image

5 – Account definitions and On-Line information have to be build, wait a few minutes and your are ON

image

Advertisements

How to reply a message with Outlook Live

In order to use this code you will need to get the GetBinding() method and understand how to get a message item UniqueId

 /// <summary>
/// Replies the message.
/// </summary>
/// <param name="messId">The mess id.</param>
/// <param name="body">The body.</param>
/// <param name="replyAll">if set to <c>true</c> [reply all].</param>
/// <returns></returns>
public static bool ReplyMessage(string messId, string body, bool replyAll)
{
	Item mess = Item.Bind(GetBinding(), messId);
	EmailMessage message = mess as EmailMessage;
	if (message != null)
	{
		MessageBody messageBody = new MessageBody(BodyType.HTML, body);
		message.Reply(messageBody, replyAll);
		return true;
	}
	return false;
}

Reset a Password from a Outlook Live Mailbox

In order to use this code you have to grab the Class Sessions from this link and read the introduction

Using Microsoft.LiveAtEdu.Samples.Powershell.OutlookLive.Users.MailBox;

// <summary>
/// Resets the password.
/// </summary>
/// <param name="caixaCorreio">Caixa correio.</param>
/// <param name="novaPassword">Nova password.</param>

public static string ResetPassword(string mailBox, string novaPassword)
{
    try
    {
        OutlookLiveMailBox mb = new OutlookLiveMailBox(Sessions.ConnectMe());
        mb.ResetPwd(mailBox, novaPassword);
        return "1";
    }
    catch (Exception ex)
    {
        return ex.Message;
    }
    finally
    {
        Sessions.DisconnectMe();
    }
}

Create a Mailbox in Outlook Live

In order to use this code you have to grab the Class Sessions from this link and read the introduction

CODE

I am returning a String to grab the Exception, if created return “1”. This work’s but for instance if a mailbox with the same name is already created it will not give any exception, at least for me.

Using  Microsoft.LiveAtEdu.Samples.Powershell.OutlookLive.Users.MailBox;

/// <summary>
/// Cria Caixa de Correio.
/// </summary>
/// <param name="primeiroNome">Nova Caixa Correio Primeiro Nome</param>
/// <param name="ultimoNome">Nova Caixa Correio ultimo nome.</param>
/// <param name="nomeParaDisplay">Nome display</param>
/// <param name="caixaCorreio">O Email a criar</param>
/// <param name="password"></param>
public static string CreateMailBox(string firstName, 
                                   string lastName, 
                                   string displayName, 
                                   string mailBox, 
                                   string password)
{
    try
    {
        OutlookLiveMailBox mb = new OutlookLiveMailBox(Sessions.ConnectMe());
        mb.CreateMailBox(firstName, lastName, displayName, mailBox, password);
        return "1";
    }
    catch (Exception ex)
    {
        return ex.Message;
    }
    finally
    {
        Sessions.DisconnectMe();
    }
}