Hi, I have tested this code with 5 email addresses and worked fine. Now I have a database where I have around 300 users and I need to send them a mass email, but when I would do this, I would get the following error. Following is the code I use for the page to send the email. Code: protected void SendEmailButton_Click(object sender, EventArgs e) { try { //create the mail message MailMessage mail = new MailMessage(); //set the addresses mail.From = new MailAddress("[email protected]"); mail.Bcc.Add(emails.ToString()); //set the content mail.Subject = "test"; mail.Body = "test"; mail.IsBodyHtml = true; //send the message SmtpClient smtp = new SmtpClient("mail.tipliga.net"); NetworkCredential Credentials = new NetworkCredential("[email protected]", "*********"); smtp.Credentials = Credentials; smtp.Send(mail); txtNaslov.Visible = false; txtText.Visible = false; ltResult.Text = "Email je uspesno poslat svim korisnicima :)"; } catch (Exception ex) { ltResult.Text = ex.ToString(); } } where emails is in the following format Code: [email protected], [email protected], etc. Why am I getting this error? Is there a limit of how many emails I can send at the time. I know this would make sense to avoid the bulk mails and spamming people, but I am just trying to send some information towards the users of the site. Please let me know whats going on. Thanks, Nik
Please review this Knowledge Base article: http://support.Winhost.com/KB/a558/what-is-the-maximum-number-of-recipients-per-email-message.aspx
Thanks for the answer. Will I be ok, since i have tested it and it works, if I due something like this... queue email addresses until I have 40 send email to 40 people, loop for more, etc... It will be like 10 consecutive mail.send commands, but I will be able to achieve what I need. thanks,
This should be fine, however, be aware of our Acceptable Use Policy regarding Mass Email: http://www.Winhost.com/about-Winhost-aup.aspx You'll probably need to implement some kind of timer in between queues.
Ok, I will. For today message I have already sent an email, since I needed to pass the message to all of the receipients. I will modify code for the future, and possibly schedule a task or something to do this. Thanks, Nikola