none
moving mailbox from exchange to office 365 in .net RRS feed

  • Question

  • Hi Guys,

    I am having a .net email sending program. there will be an email account mailbox for email sending. Currently my code accessesthese mailbox by hitting exchange services(using .asmx file). Now we are plan to move this account to office 365.

    What are things I have to consider in coding level? what are the configurations I have to make? Can anyone please help me?

    Thanks

    Wednesday, June 8, 2016 1:17 AM

Answers

  • Hi Convert,

    >> Currently my code accessesthese mailbox by hitting exchange services(using .asmx file). Now we are plan to move this account to office 365.

    Do you mean you want to change exchange server to Office 365 server to send email? If you want to send email with Office 365, you will need to Office 365 server and port.

    A simple code like below:

    SmtpClient client = new SmtpClient("smtp.office365.com",587);
                    client.EnableSsl = true;
                    client.Credentials = new System.Net.NetworkCredential("xxx@yyy.com", "password");
                    MailAddress from = new MailAddress("xxx@yyy.com", String.Empty, System.Text.Encoding.UTF8);
                    MailAddress to = new MailAddress("xxx@yyy.com");
                    MailMessage message = new MailMessage(from, to);
                    message.Body = "The message I want to send.";
                    message.BodyEncoding = System.Text.Encoding.UTF8;
                    message.Subject = "The subject of the email";
                    message.SubjectEncoding = System.Text.Encoding.UTF8;
                    // Set the method that is called back when the send operation ends.
                    client.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback);
                    // The userState can be any object that allows your callback 
                    // method to identify this send operation.
                    // For this example, I am passing the message itself
                    client.SendAsync(message, message);

    You could refer How to send a New Message using SMTP in Office365 for more information.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Thursday, June 9, 2016 2:44 AM

All replies

  • Hi Convert,

    >> Currently my code accessesthese mailbox by hitting exchange services(using .asmx file). Now we are plan to move this account to office 365.

    Do you mean you want to change exchange server to Office 365 server to send email? If you want to send email with Office 365, you will need to Office 365 server and port.

    A simple code like below:

    SmtpClient client = new SmtpClient("smtp.office365.com",587);
                    client.EnableSsl = true;
                    client.Credentials = new System.Net.NetworkCredential("xxx@yyy.com", "password");
                    MailAddress from = new MailAddress("xxx@yyy.com", String.Empty, System.Text.Encoding.UTF8);
                    MailAddress to = new MailAddress("xxx@yyy.com");
                    MailMessage message = new MailMessage(from, to);
                    message.Body = "The message I want to send.";
                    message.BodyEncoding = System.Text.Encoding.UTF8;
                    message.Subject = "The subject of the email";
                    message.SubjectEncoding = System.Text.Encoding.UTF8;
                    // Set the method that is called back when the send operation ends.
                    client.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback);
                    // The userState can be any object that allows your callback 
                    // method to identify this send operation.
                    // For this example, I am passing the message itself
                    client.SendAsync(message, message);

    You could refer How to send a New Message using SMTP in Office365 for more information.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.



    Thursday, June 9, 2016 2:44 AM
  • You can use the remote move migration wizard on the Office 365 to move existing user mailboxes in the on-premises organization to the Exchange Online organization.
    Logon office 365 portal with administrator account, open Exchange Admin Center.
    Select Recipients and click migration.
    Click Add , and then select Migrate to Exchange Online.
    4. On the Select a migration type page, select Remote move migration and then click Next.
    5. On the Select the users page, click Add  and select the on-premises users
    and click Add.
    6. Click OK, and then click Next.
    7. On the Confirm the migration endpoint page, verify that the FDQN of your on-premises Exchange server is listed when the wizard confirms the migration endpoint.
    8. On the Move configuration page, enter name in New migration batch name and then click Next.
    9. On the Start the batch page, select at least one recipient to receive the batch complete report. Verify that the Automatically start the batch option is selected, and then select the Automatically complete the migration batch check box. Click New.

    I hope this information on Exchange to office 365 migration helps!

    Tuesday, April 7, 2020 11:08 AM