I am Using .Net 1.1 mailing sending Problem in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mahesh83
    New Member
    • Feb 2007
    • 25

    I am Using .Net 1.1 mailing sending Problem in C#

    Hi


    I am Sending Thousands of mail at a time but its sends 500 or 600 mails and stops..
    So i need a solution so that it does not stop before completing the Task



    Please Help me


    Cheers
    Mahesh
  • sani723
    New Member
    • Feb 2007
    • 117

    #2
    u need an Emailer instead of doing it programatically

    Comment

    • Mahesh83
      New Member
      • Feb 2007
      • 25

      #3
      Originally posted by sani723
      u need an Emailer instead of doing it programatically
      Hi

      I am using same but it still its giving problem

      Please help me...

      Comment

      • sani723
        New Member
        • Feb 2007
        • 117

        #4
        then check the docs of ur Emailer, because through emailer u can sent as many as u want.

        Comment

        • Mahesh83
          New Member
          • Feb 2007
          • 25

          #5
          Originally posted by sani723
          then check the docs of ur Emailer, because through emailer u can sent as many as u want.
          Hi

          My code is

          Code:
          public static void SendMessage(string to, string subject, string message, MailFormat format)
          		{
          			//string smtpServer = GetConfigValue("SmtpServer");
          			//string smtpPort = GetConfigValue("SmtpPort");
          			//string smtpUsername = GetConfigValue("SmtpUsername");
          			//string smtpPassword = GetConfigValue("SmtpPassword");
          
          			MailMessage mailMessage = new MailMessage();
          
          			mailMessage.From = GetConfigValue("SystemEmail"); //from;
          #if RELEASE
          			mailMessage.To = to;
          #else
          			mailMessage.To = "mjasonrice@hotmail.com";
          #endif
          			//mailMessage.Cc = cc;
          			//mailMessage.Bcc = bcc;
          			mailMessage.Subject = subject;
          			mailMessage.Body = message;
          			mailMessage.BodyEncoding = System.Text.Encoding.Default;
          			mailMessage.BodyFormat = format;
          			mailMessage.Priority = MailPriority.Normal;
          
          //			if (attachments != null)
          //				for (int i=0; i<attachments.Length; i++)
          //					mailMessage.Attachments.Add(new MailAttachment(attachments[i], MailEncoding.Base64));
          /*
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", smtpPort);
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2);
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", smtpUsername);
          			mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", smtpPassword);
          */
          			//SmtpMail.SmtpServer = smtpServer;
          			SmtpMail.Send(mailMessage);
          		}
          
          		public static string GetConfigValue(string Key)
          		{
          			return System.Configuration.ConfigurationSettings.AppSettings[Key];
          		}
          		
          		public static string GetFileText(string FileName)
          		{
          			string text, path = string.Format("{0}\\{1}", GetConfigValue("EmailTemplates"), FileName);
          			using (StreamReader sr = new StreamReader(path)) text = sr.ReadToEnd();
          			return text;
          		}
          
          		public static void SendMessage(bool useHtml, string toEmail, string toName, string subject, string message, string linkUrl, string linkText, DataView data)
          		{
          			try
          			{
          				// build the xml document
          				string path = string.Format("{0}\\Templates\\Message.xml", GetConfigValue("EmailTemplates"));
          				XmlDocument xmlDocument = new XmlDocument();
          				xmlDocument.Load(path);
          
          				xmlDocument.DocumentElement["From"].InnerText = GetConfigValue("SystemEmail");
          				xmlDocument.DocumentElement["To"].InnerText = toName;
          				xmlDocument.DocumentElement["Body"].InnerText = message;
          				xmlDocument.DocumentElement["Link"]["URL"].InnerText = linkUrl;
          				xmlDocument.DocumentElement["Link"]["Text"].InnerText = linkText;
          
          
          where should i put Docus to assign not to stop in sending mails

          Comment

          Working...