C# - Sending Large Volume Of Emails Using C#?
Jan 20, 2010
I'm having an issue sending large volumes of emails out from an ASP.Net application. I won't post the code, but instead explain what's going on. The code should send emails to 4000 recipients but seems to stall at 385/387.
The code creates the content for the email in a string.
It then selects a list of email address to send to.
Looping through the data via a datareader it picks out the email address and sends an email.
The email sending is done by a separate method which can handle failures and returns it's outcome.
As each record is sent I produce an XML node in an XML document to log each specific attempt to send.
The loop seems to end prematurely and the XML document is saved to disk.
Now I know the code works. I have run it locally using the same SMTP machine and it worked fine with 500 records. Granted there was less content, but I can't see how that would make any difference.
I don't think the page itself times out, but even if it did, I was sure .Net would continue processing the page, even if the user saw a page time out error.
View 4 Replies
Similar Messages:
Nov 19, 2010
I'm creating a web page that will show a form that allows a user to query a database and then page backwards and forwards through the data. In other words one record of the returned data will be displayed on the form and the user can move forward to display the next record or back to display the previous one.
My problem is that a large volume of data may be returned and I'm wondering the best way to keep this data between postbacks. I would think there would be too much data to use viewstate.
View 2 Replies
Jul 26, 2010
I have a standard ASMX web service which uses a lock object to process the first request it receives and reject other requests that come in before processing completes. The web service is hosted on a Windows Server 2003 box with a single-core processor. To test whether this works as expected, I wrote a client that spawns 100 threads. Each thread makes an asynchronous POST call to the web server (i.e., HttpWebRequest.BeginGetResponse()). From my own logging, what I'm seeing on IIS is that two threads are spawned. Let's say thread IDs 1 and 7. Thread 1 is assigned a small number of requests. It accepts and processes them, one after another. Thread 7 is assigned a large number of requests. It rejects them. Does anyone have theories on the following: Why are two threads spawned? And not four or a hundred? Why does there seem to be thread discrimination? Thread 1 looks like it has control of the lock object at all times.
View 1 Replies
Jul 26, 2010
How Does IIS Handle a Large Volume of Requests
View 2 Replies
Mar 19, 2010
I have large volume of records in my database(70k).How do i handle with this kind of volume data in gridview. Is there any samples provided for this?
View 2 Replies
Mar 23, 2010
I'm developing a web app for which the client wants us to query their data as little as possible. The data will be coming from a Microsoft CRM instance.
So we've agreed that data will only be queried as and when it is needed, therefore if a web user wants to see a list of contacts (for example) that list is fetched into a local DataTable. Then if a new contact is created on the website the new contact is sent to CRM and added to the local DataTable at the same time. Likewise for edits.
If the user then looks at their contacts again the data will just come from the local DataTable.
View 2 Replies
Dec 27, 2010
In my database when I fire query it takes 40 secs on 1 crore data, similar when I use join with other table then it take more time. I have taken care non cluster index such thing. But still I want to optimize my query, what other thing I need to take like buffer, disk size etc. I am not sure on this area.
View 11 Replies
Sep 21, 2010
I've gone through this link. (http://connect.microsoft.com/VisualStudio/feedback/details/544562/cannot-send-e-mails-with-large-attachments-system-net-mail-smtpclient-system-net-mail-mailmessage)
It is not possible to send an e-mail with an attachment larger than 4 MB in .NET Framework 4.0. The same code works for small and large files if you set the target platform from .NET Framework 4.0 to .NET Framework 3.5. So this cannot be a problem with our mail-configuration! I get no error if I attach e.g. 10 files of 2 MB! I searched through Google but I didn't get it.
Workaround solution is not working fine as expected. After using this workaround for a while, I found that some files are corrupted. So this is not a solution for this bug.
We've applied that Microsoft patch and we're still seeing the issue?
View 1 Replies
Mar 12, 2010
My code sends email via asp.net mail namespace. Basically I generate HTML code which carries an image tag referring to an image on server. It uses absolute path and then the html email is sent to recipients.
Now when they receive emails on gmail and other clients, it wouldnt display images and not that images are broken but it wouldnt get displayed. Gmail is an issue wherein it prompts of non-https message and then display link on top. I know how to get around but my recipients have no clue on this technical things. so they end up not seeing the images.
How can I resolve this issue? How can I ensure that they always receive images irrespective of their internet settings?
View 3 Replies
Sep 3, 2010
Here is my situation and hopefully someone could guide me in the right direction.I have a shared or static class in my website (App_Code folder) which has static methods to send emails asychronoulsy. So whenever there is an exception in any of my pages or classes I call these methods to send an email to support asynchronously. Now when there is an exception in a page, to route that exception asynchronously I need to have Async = "true" for that page. I have more than 50 pages and I don't want to set Async= "true" on every page as I read that it affects performance.So I was wondering if there is any way I could send emails asynchronously without having to set async = "true" on every page.
View 7 Replies
Sep 21, 2010
Is there any samples on how to use ASP.NET built-in templates out of the page, just for rendering text with params. For instance, to build email message.
View 2 Replies
Mar 8, 2010
I am using the ASP.NET membership provider controls (ChangePassword and PasswordRecovery) and they generally work just fine. Unfortunately they don't send any emails once the process is finished. I set up the SMTP server using the ASP.NET Configuration Website and it added the following lines to the web.config:
<system.net>
<mailSettings>
<smtp from="maildaemon@pagetailors.de">
<network host="pagetailors.de" password="XXXX" userName="XXXX" />
</smtp>
</mailSettings>
</system.net>
I also tried using the IP adress of the server instead of the domain. In addition to that I set the maildefinition properties on the used web controls:
<MailDefinition From="maildaemon@pagetailors.de"
Subject="Your new password">
</MailDefinition>
Once I finish changing or resetting the password, the controls shows the success message. It does not show any errors but the mails are not sent. I also checked the SMTP log files on the server (it's a MailEnable server) but couldn't even find an attempt to send these messages. I am using a custom email helper class which manually sends an email using the following settings:
public static void SendEmail(string from, string to, string subject, string body)
{
SmtpClient mailClient = new SmtpClient(ConfigReader.GetStringValue("MailServer"));
mailClient.Credentials = new NetworkCredential(ConfigReader.GetStringValue("MailUsername"),
ConfigReader.GetStringValue("MailPassword"));
MailMessage mailMessage = new MailMessage(from, to, subject, body);
mailClient.Send(mailMessage);
}
The values for mailserver, username and password read from the config file are the same as defined in the ASP.NET configuration tool. These mails are delivered successfully.
View 2 Replies
Apr 12, 2010
I am writing an application that will need to send a massive amount of emails to our students who will be selected from our database (each email will be personalized to the extent that will include their name, course of study etc...so needs to be sent one at a time).
I could do this looping over an SmtpClient, but I'm afraid that with the numbers I'm trying to send, I'll ultimately run into timeout issues or my thread being killed because of lack of machine resources. if looping over SmtpClient is an ok solution, how I should go about handling it to prevent what I posted above.
View 5 Replies
Mar 15, 2011
i am developing a project wich sends massive amounts of emails. Lets say 200-300 emails per query. And each user can conduct multiple search querys. So at times it gets relly great number of emails to send.So this is what i need:1. a webservice with a fireAndForget type method, that i can pass in single or multiple email messages
View 1 Replies
Jul 10, 2010
I want to send multiple emails with high speed. I am sending a newsletter on daily basis to around 4000 contact-IDs. I developed VB.net code for sending emails through THREADS. My threads are sending Emails to my contacts. But the problem is the speed is slow. I wanted to send emails with high speed and with less email bounce ration.
View 9 Replies
May 26, 2010
We were just asked to create something that would query a db and send an individual email to each email returned in the query.
how to do this.. and its not alot of emails.. probably about 50 to 100 but each email will be customized to each receipient as they are our vendors.
View 4 Replies
Apr 29, 2010
I need to send an email in asp.net but I need sender appears like "MySiteName" without info@[URL] need to send an email in asp.net but I need sender appears like "MySiteName" without info@[URL]
View 4 Replies
Aug 26, 2010
iam using asp.net 2.0 with c#.net.
in my application when client completes its shopping email will goes to user this works fine when there is internet connection is working fine, if there is some problem in internet connection if one mail stops then all the mails will be stopped even now internet works fine,
how to resend the emails using smtp server, is there any option to resend the emails automatically when internet works fine.
View 2 Replies
May 24, 2010
i am a new comer in asp.i needed asp code for sending bulk emails for various users.
View 1 Replies
Feb 1, 2011
I use a Smtp Client to email submitted information from an asp.net form. 3 users sent in their information and the user on the other end did not recieve either one of the emails. On the 2nd time around, she did recieve the emails. What could it be?
[Code]....
View 27 Replies
Mar 25, 2013
I have a requirement like sending multiple mails for each update in database.But if i write mail sending code on button click then it will delay the page load time till all mails are send.Is there any way to send mails using seperate thread that runs at backend or maintain a queue.
One more think content of all mails are not same always.
View 1 Replies
Nov 15, 2012
public void mail()
{
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.Mail.SmtpClient smtpClient = new SmtpClient();
//create the mail message
//set the addresses
mail.From = new MailAddress("kamalakkanavar@gmail.com");
mail.To.Add(TextBox1.Text);
[CODE]...
View 1 Replies
Feb 3, 2010
I am trying to use ThreadPool.QueueUserWorkItem to send daily newsletter to my website subscribed members (about 500 members) at 2:00 am every day automatically.I placed record on txt file everytime send out email for debuging, then I found that only about 165 members been send out. every day is different number but just about.never finished whole 500 members.looks like thread aborted before finish sent out all emails.anybody knows what's going on here?I am using shared hosting, so I couldn't run my own window service for this.
View 1 Replies
Jan 30, 2010
I have a requirement of sending 3000 Emails one by one with an attachment of around 100KB, I was using System.net.mail namespace with our company mail server.my program will send upto 360 mails after that it is not sending emails,and it is not giving any exception.what is the solution to my problem.
View 13 Replies
Jan 21, 2010
I have a thread running in the background that will sleep and pull data from the database when something wakes it up. I am sending the emails using google apps using SmtpClient (code below).
I wanted to know if there is anything i be aware of? I plan to send only one email at a time (a registration or forgot password email). I am a little worried something can happen like an invalid email locking up the thread because i didnt set a timeout or maybe google apps happen to be done and causing the app to blow up. What should i be aware off? I should ask how i should test as well?
[code]....
View 4 Replies