Note that there are some explanatory texts on larger screens.

plurals
  1. POSlow thread Email Sender
    primarykey
    data
    text
    <p>I made a Razor MVC3 website, from which I can send E-Mails. </p> <p>I made a service that gets all the users and emails information, and starts a thread that sends formatted emails.<br> I made my own threadpool.</p> <p>On my computer everything work perfectly. I send emails every second.<br> But when I deploy my website on my Amazon server ec2, the email sending becomes so slow around (3min/mail) and fails half of my emails.</p> <p>The amazon server is far more powerful than my computer. Same for the bandwidth. I dont know if it is an IIS or a thread configuration than I missed.</p> <p>Any ideas?</p> <p>//----------------- Code send email------------------------</p> <pre><code>using (SmtpClient smtp = new SmtpClient() { Host = serverSMTP, Port = 25, EnableSsl = false, DeliveryMethod = SmtpDeliveryMethod.Network, Credentials = new NetworkCredential(senderAddress.Address, carteiraPassword), Timeout = 10000 }) { ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; //test smtp.Send(message); } </code></pre> <p>//-----------------class thread------------------------</p> <pre><code>public class MyThread { #region Param public string Id { get; set; } public RunNewThread RunThreadDelegate; private System.Threading.Thread Thread { get; set; } #endregion public SiscobThread(RunNewThread RunThreadDelegate) { this.RunThreadDelegate = RunThreadDelegate; } public void Init() { this.Thread = new System.Threading.Thread(this.RunThread); MsgManager.Instance.SendError("Thread born " + this.Id, null); } private void RunThread() { this.RunThreadDelegate(); } public void Start() { this.Thread.Start(); } public void Stop() { this.Thread.Abort(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload