Error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required"

Error "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required"

Hi, I'm trying to send an email via the SMTP server using C# code but getting the following error:
"The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required"
I know the username and password are correct and I can login via the web interface an send email via this account no problems. Here is my code - can any body shed any light on why this would happen? Putting an invalid password gives the same error. I also have disabled TFA.
	SmtpClient smtp = new SmtpClient("smtp.zoho.com", 587);
	smtp.EnableSsl = true;
	smtp.UseDefaultCredentials = false;
	smtp.Credentials = new NetworkCredential("user@domain.com", "password");

	MailMessage msg = new MailMessage("user@domain.com", "toaddress@adomain.com");
	msg.Subject = "hello";
	msg.Body = "world";

	smtp.Send(msg);

    • Sticky Posts

    • Pocket from Mozilla is closing shop. Don’t lose your favorites . Move them to Zoho Mail Bookmarks now! 📥🔖

      The end of Pocket shouldn't mean the end of your important links and content. Easily import them into Zoho Mail's Bookmarks and continue right where you left off. You can bring over your entire Saves, Collections, and tags just the way they are. Bookmarks
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Workplace - Zoholics Europe Customer Awards

      Dear Zoho Mail Community! 📣 We're excited to announce that at this year's Zoholics events across Europe, we're holding customer awards for the first time ever! Workplace - Zoholics Europe Customer Awards This is your chance to shout about the amazing
    • Important update on Group Management | Zoho Mail

      Dear Zoho Mail Community, This post is to inform you all of the following updates on the Group Management in Zoho Mail. Group Member Addition: If a group member is added to an organization group in a Zoho Application, the member will be automatically
    • Mastering email etiquette and best practices to follow in Zoho Mail

      Hello Zoho Mail Community, We’re thrilled to invite you all to our upcoming webinar: Mastering email etiquette and best practices to follow in Zoho Mail. Join our live webinar for expert etiquette tips to enhance your professionalism and elevate your