Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to send email upto 2000 but restriction from hosting is this that i can send only 60 email per hour. The code is given below.
It is possible that i can send email upto 2000 at once after changing in my code

What I have tried:

MailMessage mail = new MailMessage();
                   mail.To.Add(ToEmail);
                   mail.From = new MailAddress(fromEmail);
                   mail.Subject = "Subject";
                   string Body = "Email Body Message;
                   mail.Body = Body;
                   mail.IsBodyHtml = true;
                   SmtpClient smtp = new SmtpClient();
                   smtp.Host = "smtp from Hosting";
                   smtp.Port = 25;
                   smtp.UseDefaultCredentials = false;
                   smtp.Credentials = new System.Net.NetworkCredential("email", "password");// Enter seders User name and password
                   //smtp.EnableSsl = true;
                   smtp.Send(mail);
Posted
Updated 9-Feb-18 3:13am
Comments
F-ES Sitecore 9-Feb-18 9:22am    
If your host doesn't allow it then no. You might need to look for a third party email manager that can send bulk mails for you. Obviously it'll cost but at least you have a better chance they make it to the recipients.

If your hosting platform has set the limit then you need to talk to them not us.

You may be able to send 2000 at once by paying for the additional resource. You wouldn't need to change your code in that case.

Or batch up your emails and send them over the course of 2 days.

Alternatively, reconsider why you would want to send 2000 emails.
 
Share this answer
 
Comments
Member 10028394 20-Feb-18 1:27am    
Ok, Thanks Sir
No. If your hosting service is restricting you to 60 per hour, that's to prevent them being flagged as a spambot, or a bulk marketeer. This is pretty normal - most hostign services will limit emails for that very reason, though 60/hour seems a little low.

And that means the restriction will be built in at the mail server - if you exceed the hosting service limit then your email service will be suspended, and you may have to apply to get it back if you exceed the limit too often.

Your options are:
1) Talk to your hosting service and see if you can get a revised limit - you may have to pay for this.
2) Find a bulk mailer and sign up with them - this will almost certainly cost as well.
 
Share this answer
 
Comments
Member 10028394 20-Feb-18 1:27am    
Ok, Thanks Sir
OriginalGriff 20-Feb-18 2:08am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900