Posted on

Exchange Online / Microsoft 365 SMTP settings

Generic settings

  • SMTP server:
  • Port: 587
  • Requires SSL: Yes
  • Requires TLS: Yes (if available)
  • TLS version : 1.2
  • Authentication: Yes
  • Username: email address
  • Password: Your passwor

User configuration

SMTP sending is not enabled by default.

  • Log in as administrator to the account
  • Tab – Mail
  • Click on “Manage email applications”
  • Select Authenticated SMTP
Posted on

Set up an Office 365 account on GMail

This article was born from the difficulties encountered in setting up a Microsoft Office 365 mail account on the Gmail mail client on a smartphone. But

Reading Office 365 in Gmail is not recommended.

In the Gmail add account screen, the most obvious attempt is to add the account using “Exchange and Office 365”.

You will see the mailbox added correctly and working but we have encountered problems: in some accounts on Gmail you do not see all the mail folders in the mailbox.


The solution is to perform an installation in imap.

Install the account using “Other”:

Once you have entered your email account, the “Manual Configuration” button appears.

Push it. The procedure will ask you in sequence:

address of the mail arrival server:
address of the mail receiving server:

The procedure does not require the specification of ports. For the sake of completeness, we recall all the parameters of the Microsoft Office 365 imap and smtp.

IMAP settings – Server name: – Port: 993 – Encryption method: SSL

SMTP settings – Server name: – Port: 587 – Encryption method: TLS or STARTTLS


By doing this you deactivate the synchronization of address book, calendar and email. To solve it, simply go to the Outlook app, in the account and reactivate the synchronization.

But remember that the best thing for Office365 is to use the Outlook app on smartphones. Reading Office 365 in Gmail is not recommended.


Posted on


Our site needs to send emails to its users, for example when the user forgets the password. To do this comes to the rescue System.Net.Mail.SmtpClient class.

This class automatically uses the SMTP server settings stored in the Web.config file. You just have to add to that file the following tags inside the configuration tag:

 <smtp deliveryMethod="Network" from="mail_from">
 <network host="my_smtp_server" port="my_smtp_server_port" userName="user_name_smtp" password="password" clientDomain="my_domain" />


In the view Account/Login , you can see, bottom, on the left, the link to Account/ForgotPassword that is the page where the user can reset his password.

In the  controller Account, in the action post  “ForgotPassword” you make operational, removing them as a comment, the lines of code dedicated to password recovery.

In the file IdentityConfig.cs, in the function

public Task SendAsync(IdentityMessage message)

and replaced to the line

return Task.FromResult(0);

with the following lines of code

var sentFrom = ""
 System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
 client.EnableSsl = false;

// Create the message:
 var mail =
 new System.Net.Mail.MailMessage(sentFrom, message.Destination);

mail.Subject = message.Subject;
 mail.Body = message.Body;
 mail.IsBodyHtml = true;

// Send:
 return client.SendMailAsync(mail);

You have activated the password recovery