title: email sending failed in C# windows application with windows 7 32-bit operating System
body: <p>i have developed code in C# for sending multiple emails with multiple attachment. 
  In widows 7,8 with 64 bits operating system not getting problem and sending mails is successfully. But when i trying in 32-bit operation system it is getting error "Email sending failure" or unable to connect remote server, so what should i do for sending my mail with attachment through windows 32-bit in c# application </p>
  
  <pre><code>enter code here
          //try
          //{
              //timer1.Start();
              progressBar1.Visible = true;
              backgroundWorker1.RunWorkerAsync();
              ////////////////////////////////////////////////////////////////
              this.crystalReportViewer1.RefreshReport();
              int d = Convert.ToInt32(strUserId1);
              SqlDataAdapter da = new SqlDataAdapter("select * from Customer_Info where billno=" + d + "", con);
              DataTable dt = new DataTable();
              da.Fill(dt);
              string customeremail;
              string subject;
              customeremail = dt.Rows[0].ItemArray[10].ToString();
  
              subject = dt.Rows[0].ItemArray[13].ToString();
  
  
              //Report crp = new Report();
              TaxInvoice po = new TaxInvoice();
              po.SetDataSource(dt);
              po.Load(Application.StartupPath + "\\TaxInvoice.rpt");
              //rd.Load("StudentReg.rpt");
              po.SetDataSource(dt);
              crystalReportViewer1.ReportSource = po;
              crystalReportViewer1.Refresh();
              if (File.Exists(@"E:\Demand letters\" + customeremail + ".pdf"))
                  File.Delete(@"E:\Demand letters\" + customeremail + ".pdf");
              po.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"E:\Demand letters\" + customeremail + ".pdf");
              string path = "E:\\Demand letters\\" + customeremail + ".pdf";
              System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
              SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com",587);
              mail.From = new MailAddress("chavan.shekhar1989@gmail.com");
              da.Fill(dt);
  
              if (dt.Rows[0].ItemArray[10].ToString() == "" || dt.Rows[0].ItemArray[10].ToString() == null)
              {
              }
              else
              {
                  customeremail = dt.Rows[0].ItemArray[10].ToString();
                  mail.To.Add(customeremail);
              }
              mail.Subject = subject;//"Demmand Letter";
              mail.IsBodyHtml = true;
              string htmlBody;
              htmlBody = "Thank You,";
              mail.Body = htmlBody;
             // SmtpServer.Port = 587;//587
              SmtpServer.Credentials = new
              System.Net.NetworkCredential("xyz@gmail.com", "password");
              SmtpServer.EnableSsl = true;
              Attachment a = new Attachment("E:\\Demand letters\\" + customeremail + ".pdf");
              mail.Attachments.Add(a);
              SmtpServer.Send(mail);
              progressBar1.Visible = false;
             // timer1.Stop();
              MessageBox.Show("Mail has been sent Successfully.", "meanform", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
  </code></pre>