Problem while trying to send attachment in email C# using zoho smtp mail

Problem while trying to send attachment in email C# using zoho smtp mail

 CDO.Message message = new CDO.Message();
                CDO.IConfiguration configuration = message.Configuration;
                ADODB.Fields fields = configuration.Fields;

                ADODB.Field field = fields[" http://schemas.microsoft.com/cdo/configuration/smtpserver"];
                field.Value = "smtp.zoho.com";

                field = fields[" http://schemas.microsoft.com/cdo/configuration/smtpserverport"];
                field.Value = 465;

                field = fields[" http://schemas.microsoft.com/cdo/configuration/sendusing"];
                field.Value = CDO.CdoSendUsing.cdoSendUsingPort;

                field = fields[" http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"];
                field.Value = CDO.CdoProtocolsAuthentication.cdoBasic;

                field = fields[" http://schemas.microsoft.com/cdo/configuration/sendusername"];
                field.Value ="username";

                field = fields[" http://schemas.microsoft.com/cdo/configuration/sendpassword"];
                field.Value = "password";

                field = fields[" http://schemas.microsoft.com/cdo/configuration/smtpusessl"];
                field.Value = "true";

                fields.Update();

                Console.WriteLine(String.Format("Building CDO Message..."));

                message.From ="from email";
                message.To = "to email";
                message.Subject = "Test message.";
                message.TextBody = "This is a test message. Please disregard.";
   // Send message.
 var fPath1 = Server.MapPath("~/Resources/Temp/train details.txt");                
                message.AddAttachment(fPath1);
                message.Send();

      • Sticky Posts

      • Zoho Developer Community Monthly Digest - October 2024

        Hello everyone, This edition highlights October's product updates, upcoming community events, engaging discussions that sparked inspiration, and celebrates the top contributors who drove progress. Grab your favorite beverage and dive in! Upcoming Events
      • Zoho Developer Community Monthly Digest - September 2024

        Hello everyone, This month's Developer Digest is packed with resources to help you build powerful applications. Learn how to leverage Zoho CRM's new features, explore the latest in Zoho Finance and Catalyst, and join exciting bootcamps, webinars, and
      • Zoho Developer Community Monthly Digest - August 2024

        Hello everyone, Get ready for another exciting month of Zoho development! Our August digest is packed with events, resources, and community discussions to empower you as a Zoho developer. Let's dive right in! Upcoming Events To stay on top of the upcoming
      • Extensions 101: Build Extensions for Zoho Finance suite

        Hello Developers! We are thrilled to announce our 5-day webinar series on building extensions for Zoho Finance Suite products. Our first session was a resounding success, introducing Extensions, Zoho Developer, Zoho Marketplace, and the Zoho Books Developer
      • Zoho Developer Community Monthly Digest - July 2024

        Hello everyone, We're here again with July month's digest packed with exciting events, resources, updates, and community discussions to empower you as a Zoho developer. Dive right in! Upcoming Events To stay on top of the upcoming developer community