Solved

Sending Email in Visual studio Can only send out 11 at a time!

Posted on 2010-09-02
5
1,358 Views
Last Modified: 2013-11-27
After 11 emails I get the following error.

Insufficient system storage. The server response was: 4.1.0 Too many emails sent on this session

I read enough to know that this is a common error with the logic I am using, but most people comment the threshold is 100 emails.. 100 would be fine, as I have to send out about 83 - 90..
But my email list could grow.

So is there a different method I should be using? If not is there something I can do to get my threshold up to at least 100?

Below is the code I am using.
for (int idx = 0; idx < lstUnitInfo.Count; idx++)
        {
           mMailMessage = new MailMessage();
           // Set the sender address of the mail message
           mMailMessage.From = new MailAddress("wendavcs@comcast.net");
           string setSubject = "";
           try
            {
                sglUnitInfo = lstUnitInfo[idx];
                // Set the recepient address of the mail message
                setSubject = "Training Information for " + sglUnitInfo.UnitType +
                    " " + sglUnitInfo.UnitNo;
             
               
               mMailMessage.Subject = setSubject;

                //The To: recipient.. attach 
                if (NormalTest == "Test")
                    mMailMessage.To.Add(new MailAddress(testEmail));
                else
                {
                    for (int i = 0; i < 2; i++)
                    {
                        if (sglUnitInfo.Email[i] != null && sglUnitInfo.Email[i].IndexOf("@") != -1)
                            mMailMessage.To.Add(new MailAddress(sglUnitInfo.Email[i]));
                    }
                }


                SetAttachments();
                PrintBody();

                mMailMessage.Body = fullBody;


                // this is if through IIS
                //SmtpClient mSmtpClient = new SmtpClient("localhost");

                // Instantiate a new instance of SmtpClient
                SmtpClient mSmtpClient = new SmtpClient("smtp.comcast.net");


                // Send the mail message
                mSmtpClient.Send(mMailMessage);

                mMailMessage.To.Clear();
                mMailMessage.Attachments.Clear();
                mSmtpClient = null;
                UpdateTableDate(sglUnitInfo.UnitType, sglUnitInfo.UnitNo);

            }
            catch (Exception)
            {

                throw;
            }
            finally
            {
                if (attachmentmsg1 != null)
                {
                    attachmentmsg1.Dispose();
                    attachmentmsg2.Dispose();
                    attachmentmsg3.Dispose();
                    attachmentmsg4.Dispose();
                    attachmentmsg5.Dispose();
                    attachmentmsg6.Dispose();
                    if (mMailMessage != null)
                        mMailMessage.Dispose();
                    
                }
            }
        }

Open in new window

0
Comment
Question by:moosetracker
  • 3
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 33592756
That's a limit by your ISP, Comcast.  It's not likely that they will change it for you.  Some ISPs set the limit at 25.  Yahoo on a paid account was setting it at 25 emails Per Day.  It's an anti-spam thing.

Bulk email services like Constant Contact have their own servers.  They also work with large email services like Gmail, Yahoo, and Hotmail to help get the emails delivered.  You could get your own web hosting and send out emails from there.  But if you send too many, they will shut you down too.
0
 
LVL 1

Author Closing Comment

by:moosetracker
ID: 33592864
Not what I was hoping to hear, but thanks. Seems I can have alot of contacts in one email, Just not many seprate emails.

I might try grouping Training annoucements together more for ones that are just general information.

Unfortunately If I am sending confidentail information I have to leave it at sending out individual unit per unit.

I set up to update a date field when the email is sent, then when it blows the next run will bypass the units that the date has been set to current date. But I have to run through about 7 abnoxious errors to get the emails completely out.

Seems like if coming out of the program and then going back in resets and lets me send out 11 more, there should be something that we could reset programmically.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33593191
No, you need to limit how many contacts in an email also.  When your email hits the server, it gets repeated as many times as there are contacts and that's what counts to your ISP.

You should be aware that ISPs like Comcast and AT&T and the email services like Gmail, Yahoo, and Hotmail are more concerned about limiting spam than delivering your email.  If you exceed their limits, they usually just cut you off.  That's why we keep recommending the services like Constant Contact.  Bulk email is their business.  Some of them are free also.
0
 
LVL 1

Author Comment

by:moosetracker
ID: 33594695
Thanks I will look into that, Free is good as this is voluntery work, with no capital from a Buisness.

 Weird with my units some I have 1 contact others 2 or 3.. Doesn't matter if within the entire group I have sent out 11 emails or 33 in all.. It always cuts off at 11 seperate emails. Also my in-laws use the same service they are into passing everyone in the world jokes and stories. The list of email contacts they seem to throw into one email is outragous!
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33597980
I know what you mean but I don't know how to explain that.  I just know that we get a lot of questions here about bulk email with the same problems over and over.  I can't recommend that you try it and see if you get lucky.  All I can do is tell you about the known problems and solutions.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question