Solved

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

Posted on 2010-09-02
5
1,365 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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