title: Send mail from Office365 on godaddy servers
body: <p>For an app I am writing an api service in c#. The site is hosted on a godaddy server. We have a office 365 account as well. I am trying to send main in my c# code through this accounts credentials. Earlier we had elasticemail smtp account. The same code was working fire with elasticemail account. But this code is not working with office 365 account.</p>
  <pre><code>smtpClient.Host = &quot;smtp.office365.com&quot;;
                      smtpClient.EnableSsl = true;
                      smtpClient.Port = 25;
                      MailMessage message = new MailMessage();
                      MailAddress fromAddress = new MailAddress(&quot;my365email@domain.com&quot;);
                      MailAddress toAddress = new MailAddress(&quot;toaddress@yahoo.com&quot;);
                      smtpClient.Credentials = new System.Net.NetworkCredential(&quot;my365email@domain.com&quot;, &quot;password&quot;);
                      message.From = fromAddress;
                      message.To.Add(toAddress);
                      message.Subject = &quot;This is the subject line&quot;;
                      message.Body = &quot;This is a test mail&quot;;
                      smtpClient.Send(message);
  </code></pre>