Solved

ASP.NET / VB.NET mass mailer help (A LEGIT MAILING LIST)

Posted on 2004-08-03
4
503 Views
Last Modified: 2006-11-17
I'm responsible for maintaining the email mailing list for the organization I work for. To subscribe to our mailing list users must sign up via the sign-up page on our website, or check an unchecked box when entering a contest thru our site. We do not share or sell our list to third parties and we give our subscribers multiple ways to unsubscribe. We are in compliance with the CAN-SPAM Act of 2003.

Now that that's out of the way...

We have a mailing list with 2000 names on it. I've made an ASP.NET application with VB.NET that loops thru a datareader and sends out an HTML email to each subscriber. The mail server I'm connecting too is Microsoft Exchange Server 5.5. My code inside the loop looks something like this:

----------------------------------------------------
        While DR.Read

                strEmailAddy = DR("email")
                strCombinedMail = strMailHTML + strMailFooter

                objMM.From = "mailinglist@message.com"
                objMM.To = strEmailAddy
                objMM.Body = strCombinedMail
                objMM.Subject = "News You Can Use"
                objMM.BodyFormat = Mail.MailFormat.Html

                Mail.SmtpMail.SmtpServer = MAILSERVER.NAME.PATH

                Mail.SmtpMail.Send(objMM)

        End While
--------------------------------------------------------

And it works fine. It takes maybe 20-40 minutes to send out a little over 2000 messages.

We have a second mailing list that has almost 45,000 email addresses. If I use the exact same code to loop thru a datareader filled with the 45,000 rows, I get a time out error after 2000-3000 messages are sent.

I'm looking for a solution to this problem. Anything from use a different object to send the emails to code the application with PHP to make an adjustment to Microsoft Exchange server, or code so it can handle that many emails.

Does anyone have experience writing similiar code for an application? How did you do it?

Thank You,
Scott
0
Comment
Question by:sneidig
[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
  • 2
4 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 11718627
Since you are sending same mail to every one. Why dont you try to build a single string of Email addresses and Mail a single mail using BCC field.

------------------------------------------------------------------------------------------------------------------------------------
        strEmailAddy = ""
        While DR.Read

>>>          strEmailAddy = strEmailAddy + ";" + DR("email")

        End While
>>>         DR.Close

                strCombinedMail = strMailHTML + strMailFooter

                objMM.From = "mailinglist@message.com"
>>>         objMM.To = ""
>>>         objMM.Bcc = strEmailAddy
                objMM.Body = strCombinedMail
                objMM.Subject = "News You Can Use"
                objMM.BodyFormat = Mail.MailFormat.Html

                Mail.SmtpMail.SmtpServer = MAILSERVER.NAME.PATH

                Mail.SmtpMail.Send(objMM)
------------------------------------------------------------------------------------------------------------------------------------


-tushar
0
 

Author Comment

by:sneidig
ID: 11718759
Thank for the response Tushar.

There are a few reasons we don't want to put the email address(es) in the bcc field.

 - For each email message that gets sent out I can create a unique unsubscribe link in the footer created with the users email address or another unique ID. For exampe the url that gets created may look something like this: http://www.mywebsite.com/news/unsubscribe.aspx?email=pleaseremove@email.com
Then I can pull that email address out of the url when the page loads and I can automatically have that email address unsubscribed from the list.

 - Along the same lines as the point above, if someone chooses to just reply to one of our mailings with the word UNSUBSCRIBE in the subject line, I can look at the from field or the url that was generated for the unsubscribe link and find out exactly what email address to search for in our database and unsubscribe. It doesn't happen very often but I've found, when using the bcc field technique that, people will reply hoping to UNSUBSCRIBE from an address that the mailing wasn't sent too - like the email got forwarded from one account to another and then they replied from the second account. At that point I can't remove them from the list without writing back to ask them if they have another email address and I find that solution to be an inconvenience to our subscribers.

 - I have reason to believe that adding many names to the bcc field of an email increases the file size of the overall email. For instance 100 names in the bcc field may add 20k to the email because those addresses are in the header. I would like to keep the mailer as small as possible.

Thanks for the response though it isn't exactly the ideal solution for my problem.

Scott
0
 

Author Comment

by:sneidig
ID: 11813018
I can't believe that not a single person has ever solved this problem before. Why isn't anyone answering? Was my question poorly worded? I'm still trying to figure out a solution.
0
 
LVL 1

Accepted Solution

by:
Roger3 earned 500 total points
ID: 12088766
Your timeout is due to the page timeout in IIS. The asp page itself is timing out. One solution (don't recommend it) woudl be to up the page timeout for your default website.

A better solution would be to take the code you have written, and write a windows or concole application. What are you using to write your asp pages? What other development tools do you have access to?

Personally, I have written a different solution. I save each piece of the email (to, from, body, title, etc... ) to a table in the database. I have a windows service that grabbs 100 messages at a time, and sends them out. If the smtp.sent is successful, it marks that entry in the database table as 'sent'.

Please post more detail if we have missed the mark.

Roger
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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