sneidig
asked on
ASP.NET / VB.NET mass mailer help (A LEGIT MAILING LIST)
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
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
ASKER
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
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
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
--------------------------
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