This code work fine from local machine and send email but in godaddy production environment

not sending email.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Web;

/// <summary>
/// Summary description for MailSer
/// </summary>
public class MailSer
{
    public MailSer()
    {

    }
    String MailFrom;
    String MailTo;
    String Subject;
    String Body;
    public String sendMail(String MailTo, String Subject, String Body)
    {
        String str = "0";
        try
        {
            using (SmtpClient smtpClient = new SmtpClient())
            {
                smtpClient.Host = "outlook.office365.com";
                smtpClient.EnableSsl = true;
                smtpClient.Port = 587;
                MailMessage message = new MailMessage();
                MailAddress fromAddress = new MailAddress("");
                MailAddress toAddress = new MailAddress(MailTo);
                smtpClient.Credentials = new System.Net.NetworkCredential("", "");
                message.From = fromAddress;
                message.To.Add(toAddress);
                message.IsBodyHtml = true;
                message.Subject = Subject;
                message.Body = Body;
                smtpClient.Send(message);
                str = "1";

            }
        }
        catch
        {
            str = "Connect TO Mail Failed";
        }
        return str;
    }
}