#Requires -Version 5.1 <# JbTecWiz Support Centre -- generated fix script Fault : Send and receive errors -- 0x800CCC0E, 0x8004210A, 0x800CCC0F Fix : Correct the server, port and encryption settings Source: https://jbtecwiz.com/support/win-office-send-receive Run as : Outlook account settings, as the affected user Expect : 30 minutes Risk : low Reversible : yes WHEN THIS IS THE RIGHT FIX A POP or IMAP account set up by hand, or an account that fails only when sending. HOW TO UNDO IT Note the previous values before changing them; put them back if the change does not help. This script walks the fix one step at a time and asks before each one. Steps with no command are things you do yourself -- it prints those and waits. Run with -DryRun to print without executing. #> [CmdletBinding()] param( # Print every step and command without running anything. [switch]$DryRun, # Do not ask before each step. Read the script first if you use this. [switch]$Unattended ) $ErrorActionPreference = 'Stop' $script:Failed = 0 # - THIS SCRIPT WILL NOT RUN UNTIL YOU EDIT IT - # The commands below contain values only you can supply. Search the # script for each one, replace it, then delete this block. $script:MustEdit = @( 'yourprovider.com' # a placeholder domain ) if ($script:MustEdit.Count) { Write-Host "" Write-Host ' This script needs editing before it can run.' -ForegroundColor Yellow Write-Host ' Replace each of these with a real value:' -ForegroundColor Yellow $script:MustEdit | ForEach-Object { Write-Host (" " + $_) -ForegroundColor Yellow } Write-Host "" Write-Host ' Then delete the $script:MustEdit block near the top.' Write-Host "" exit 2 } function Write-Rule { param([string]$Text) Write-Host '' Write-Host ('-' * 70) -ForegroundColor DarkGray if ($Text) { Write-Host $Text -ForegroundColor Cyan } } function Show-Prose { param([string]$Text, [string]$Colour = "Gray") if (-not $Text) { return } $words = $Text -split "\s+"; $line = " " foreach ($w in $words) { if (($line.Length + $w.Length) -gt 74) { Write-Host $line -ForegroundColor $Colour; $line = " " } $line += "$w " } if ($line.Trim()) { Write-Host $line -ForegroundColor $Colour } } function Invoke-Step { param( [int]$Number, [string]$Do, [string]$Why, [scriptblock]$Command, [switch]$Manual, [string]$Shell = "powershell" ) Write-Rule " Step $Number of 5" Show-Prose $Do "White" if ($Why) { Write-Host ""; Show-Prose $Why "DarkGray" } if ($Manual) { Write-Host '' Write-Host ' -> Do this yourself, then press Enter to carry on.' -ForegroundColor Yellow if (-not $Unattended -and -not $DryRun) { [void](Read-Host) } return } Write-Host '' foreach ($l in ($Command.ToString().Trim() -split "`n")) { Write-Host (" " + $l.Trim()) -ForegroundColor Green } Write-Host '' if ($DryRun) { Write-Host " (dry run -- not executed)" -ForegroundColor DarkGray; return } if (-not $Unattended) { $a = Read-Host " Run this step? [Y]es / [S]kip / [Q]uit" if ($a -match "^[Qq]") { Write-Host " Stopped at your request."; exit 0 } if ($a -match "^[Ss]") { Write-Host " Skipped." -ForegroundColor DarkGray; return } } try { & $Command } catch { $script:Failed++ Write-Host (" Step $Number failed: " + $_.Exception.Message) -ForegroundColor Red Show-Prose "The rest of the fix may depend on this. Read the write-up before carrying on." "Red" if (-not $Unattended) { $c = Read-Host " Carry on anyway? [y/N]" if ($c -notmatch "^[Yy]") { exit 1 } } } } Write-Rule Write-Host ' Send and receive errors -- 0x800CCC0E, 0x8004210A, 0x800CCC0F' -ForegroundColor White Write-Host ' Correct the server, port and encryption settings' -ForegroundColor Cyan Write-Host '' Write-Host ' Risk: low Reversible 30 minutes' Write-Rule if (-not $Unattended -and -not $DryRun) { $go = Read-Host ' Ready? [y/N]' if ($go -notmatch "^[Yy]") { Write-Host " Nothing was changed."; exit 0 } } Invoke-Step -Number 1 -Do 'Confirm the machine can reach the SMTP port the account is configured for.' -Why 'A failure here and not on 993 or 995 is why receiving works and sending does not. Many networks and most consumer ISPs block outbound port 25 to stop spam, so an account configured for 25 will receive perfectly and never send.' -Command { Test-NetConnection smtp.yourprovider.com -Port 587 | Select-Object RemoteAddress, TcpTestSucceeded } Invoke-Step -Number 2 -Do 'Open File -> Account Settings -> Account Settings -> the account -> Change -> More Settings -> Advanced, and compare against what the provider publishes. The usual current values are 993 with SSL/TLS for IMAP, 995 with SSL/TLS for POP, and 587 with STARTTLS for SMTP.' -Manual Invoke-Step -Number 3 -Do 'On the Outgoing Server tab, confirm "My outgoing server (SMTP) requires authentication" is ticked. An unauthenticated SMTP submission is refused by every current provider.' -Manual Invoke-Step -Number 4 -Do 'Raise the server timeout on the Advanced tab to 5 minutes if the connection is slow or the mailbox is large.' -Why '0x8004210A is literally a timeout. The default is one minute, which a slow link or a large first sync will exceed.' -Manual Invoke-Step -Number 5 -Do 'If the provider has moved to modern authentication, a manually configured POP or IMAP account with a plain password will now be refused regardless of ports. Remove it and let autodiscover set the account up instead.' -Manual Write-Rule " Confirm it worked" Show-Prose 'Send/Receive completes with no error, and a test message to yourself arrives.' 'White' Write-Rule if ($script:Failed -gt 0) { Write-Host (" Finished with " + $script:Failed + " failed step(s).") -ForegroundColor Yellow Show-Prose 'Read the full write-up at https://jbtecwiz.com/support/win-office-send-receive' 'Yellow' } else { Write-Host ' Finished.' -ForegroundColor Green } Write-Host '' Show-Prose 'To undo: Note the previous values before changing them; put them back if the change does not help.' 'DarkGray' Write-Rule