none
Unable to send office 365 mail using asp.net - No connection could be made because the target machine actively refused it xx.xxx.xxx.x:443 RRS feed

  • Question

  • I am unable to send office 365 mail using ASP.NET, getting error "No connection could be made because the target machine actively refused it xx.xxx.xxx.x:443". I have tried many codes online, still no luck.

    • Moved by CoolDadTx Friday, December 20, 2019 2:57 PM ASP.NET related
    Wednesday, December 18, 2019 11:01 AM

All replies

  • Hello,

    Couple of things to look at

    • Firewall setting may be blocking your connection for the used port, a quick way to know is to temporarily disable the firewall.
    • Using NetworkCredential smtp.Credentials = New NetworkCredential("sender mail userName", "sender mail password")

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, December 18, 2019 12:14 PM
  • I am unable to send office 365 mail using ASP.NET, getting error "No connection could be made because the target machine actively refused it xx.xxx.xxx.x:443". I have tried many codes online, still no luck.

    TCP port 443 is the  TSL/SSL port,  and maybe,  you need a HTTPS certificate on the client machine that the mail server machine and program are looking for and connection is actively being refused by the mail server. 

    • Edited by DA924x Wednesday, December 18, 2019 1:03 PM
    Wednesday, December 18, 2019 1:03 PM
  • This is potentially related to the app pool you are running under. Please post your question in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, December 20, 2019 2:57 PM