Solved

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

Posted on 2010-09-02
5
1,330 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 82

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 82

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 82

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now