How to block sending mail access on office 365

To block sending mail access on Office 365, you can use the following methods:

Method 1: Using Office 365 Security & Compliance Center

  1. Sign in to the Office 365 Security & Compliance Center with your admin credentials.
  2. Go to Protection > Policy > Email Policy.
  3. Click on New Policy and select Email Policy.
  4. In the Policy Name field, enter a name for the policy (e.g., "Block Sending Mail").
  5. In the Policy Type field, select Email Policy.
  6. Under Rules, click on Add Rule.
  7. Select Block as the rule action.
  8. In the Condition field, select Sender and then Is.
  9. In the Value field, enter the email address or domain you want to block (e.g., @example.com).
  10. Click Save to save the policy.

Method 2: Using Office 365 Exchange Admin Center

  1. Sign in to the Office 365 Exchange Admin Center with your admin credentials.
  2. Go to Mail flow > Rules.
  3. Click on New Rule.
  4. Select Block as the rule action.
  5. In the Condition field, select Sender and then Is.
  6. In the Value field, enter the email address or domain you want to block (e.g., @example.com).
  7. Click Save to save the rule.

Method 3: Using PowerShell

  1. Open PowerShell and connect to your Office 365 tenant using the following command: Connect-ExchangeOnline -UserPrincipalName <your_admin_email> -ShowProgress $true
  2. Run the following command to create a new transport rule: New-TransportRule -Name "Block Sending Mail" -Subject "Block sending mail" -Condition "Sender -eq *@example.com" -Action "Block"
  3. Run the following command to enable the rule: Enable-TransportRule -Identity "Block Sending Mail"

Note: Replace *@example.com with the email address or domain you want to block.

After creating the rule, it may take some time for the changes to propagate. You can verify the rule by sending an email from the blocked email address or domain and checking if it is blocked.

Remember to test the rule thoroughly to ensure it is working as expected and does not block legitimate emails.