.NETGURU
mail send
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngspeed' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Ahmed, Salman
I am sending emails out, which is faster and less bandwitdh (or is it the
same):

1. Loop through the list and SMTP.Send on each iteration of loop.

2. Build a string of email addresses, then SMTP.Send ONCE with all users in
MailMessage.BCC ie. blind carbon copy?

Reply to this message...
 
    
Jason Salas
Hi Salman,

I asked this a few months ago myself. :)

Because of the restrictions imposed by SMTP servers at the distant end, it's
probably more advisable to send one e-mail per recipient, or break up a
mailing into smaller groups of recipients, perhaps 50. SMTP servers like
AOL, MindSpring, or other big ones might not allow extraordinarily large Bcc
recipient fields, and thus might reject your message. I've used a
workaround for this having to throttle my mailings out in chunks.

So the loop fragment could be as coded follows:

objMailMessage = New MailMessage
objMailMessage.From = "Click here to reveal e-mail address"
objMailMessage.Subject = "Hello there!"
objMailMessage.Priority = MailPriority.High
objMailMessage.Bcc = "Click here to reveal e-mail address"
objMailMessage.Body = "Hello world!"
objMailMessage.BodyFormat = MailFormat.HTML
Do While objDataReader.Read()
objMailMessage.To = objDataReader("Email") ' assumes you've
declared an instantiated a a SqlDataReader object and have a DB column named
"Email"
SmtpMail.SmtpServer = "localhost" ' This is a new mandate
for .NET V1
SmtpMail.Send( objMailMessage )
Loop

The only performance hit you'll incur with this method is on your own SMTP
server, in sending out <X> number of e-mails messages for <X> recipients.

HTH,
Jason

----- Original Message -----
From: "Ahmed, Salman" <Click here to reveal e-mail address>
To: "aspngspeed" <Click here to reveal e-mail address>
Sent: Saturday, March 16, 2002 2:08 AM
Subject: [aspngspeed] mail send

[Original message clipped]

Reply to this message...
 
    
Ahmed, Salman
Yes, that is very close to what I have now. I have the mailFormat set to
TEXT as I am scared that html might increase my bandwitdth transfers! I
wish I could measure how much bandwidth is benig eaten up per email batch.

One email is prolly around 4-5k i would guess?

-----Original Message-----
From: Jason Salas [mailto:Click here to reveal e-mail address]
Sent: Friday, March 15, 2002 6:18 PM
To: aspngspeed
Subject: [aspngspeed] Re: mail send

Hi Salman,

I asked this a few months ago myself. :)

Because of the restrictions imposed by SMTP servers at the distant end, it's
probably more advisable to send one e-mail per recipient, or break up a
mailing into smaller groups of recipients, perhaps 50. SMTP servers like
AOL, MindSpring, or other big ones might not allow extraordinarily large Bcc
recipient fields, and thus might reject your message. I've used a
workaround for this having to throttle my mailings out in chunks.

So the loop fragment could be as coded follows:

objMailMessage = New MailMessage
objMailMessage.From = "Click here to reveal e-mail address"
objMailMessage.Subject = "Hello there!"
objMailMessage.Priority = MailPriority.High
objMailMessage.Bcc = "Click here to reveal e-mail address"
objMailMessage.Body = "Hello world!"
objMailMessage.BodyFormat = MailFormat.HTML
Do While objDataReader.Read()
objMailMessage.To = objDataReader("Email") ' assumes you've
declared an instantiated a a SqlDataReader object and have a DB column named
"Email"
SmtpMail.SmtpServer = "localhost" ' This is a new mandate
for .NET V1
SmtpMail.Send( objMailMessage )
Loop

The only performance hit you'll incur with this method is on your own SMTP
server, in sending out <X> number of e-mails messages for <X> recipients.

HTH,
Jason

----- Original Message -----
From: "Ahmed, Salman" <Click here to reveal e-mail address>
To: "aspngspeed" <Click here to reveal e-mail address>
Sent: Saturday, March 16, 2002 2:08 AM
Subject: [aspngspeed] mail send

[Original message clipped]

| [aspngspeed] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngspeed.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Ken Schaefer (VIP)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ahmed, Salman" <Click here to reveal e-mail address>
Subject: [aspngspeed] Re: mail send

: Yes, that is very close to what I have now. I have the mailFormat set to
: TEXT as I am scared that html might increase my bandwitdth transfers! I
: wish I could measure how much bandwidth is benig eaten up per email batch.
:
: One email is prolly around 4-5k i would guess?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Send an email to yourself, then use your email client to view the whole
message (headers and all), and cut-n-paste it into Notepad. Save the file,
and then see how big the file is. That's how big each message is. Add on
another 5-10% percent for TCP/IP overhead, and you have the total bandwidth
used by that message.

Just for reference your message to the list, which I replied to, was 3619
bytes

Cheers
Ken

Reply to this message...
 
 
System.Data.SqlClient.SqlDataReader
System.Web.Mail.MailFormat
System.Web.Mail.MailMessage
System.Web.Mail.MailPriority
System.Web.Mail.SmtpMail




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification