?
Solved

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

Posted on 2004-08-03
4
Medium Priority
?
524 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 1500 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

764 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