Async Mail

N

Newbie

Hi all,

I'm looking for a way to send newsletter to my subscribers (1000+ in total).
I've managed to do it using .NET system.net.mail.smtpclient's sendAsync. I
read the email addresses from a table (in a MSSQL DB) using sqldatareader,
then looping through it to read each email address and add it to the
instance's 'TO' property (e.g: mail.to.add(r.item("email_addr")) ).

I test run it with my own addresses to see how it works.
And successfully send it asynchronously.

There's a minor prob that I need some insights from all of you guys: all the
email addresses that's being sent to are listed in the 'TO' field of each
email sent.
Suppose I send to 5 addresses, all 5 emails sent out having those 5 email
addresses in the 'TO' field.
What I want is: the 'TO' field of the sent-out email displaying only one
address (the recipient's email address), to give it a more personal touch.

Any idea on how to do it?

Many thanks,
Mike
 
G

Guest

You are obviously adding email adresses to the to property of one instance of
a system.net.mail.smtpclient object and then sending the email. If you
create an instance of the system.net.mail.smtpclient object add the to
address and then send the mail, all in your loop, then it will send
compeltely seperate emails. Alternatively you could try adding recipients as
BCC addresses as this would scale better, but you would probably have to use
some spurious address (e.g. do (e-mail address removed)) for the To address
and this can trigger spam filters.
 
M

Mark Rae

You are obviously adding email adresses to the to property of one instance
of
a system.net.mail.smtpclient object and then sending the email. If you
create an instance of the system.net.mail.smtpclient object add the to
address and then send the mail, all in your loop, then it will send
compeltely seperate emails.

That's what I do...
Alternatively you could try adding recipients as
BCC addresses as this would scale better, but you would probably have to
use
some spurious address (e.g. do (e-mail address removed)) for the To
address
and this can trigger spam filters.

That's correct, which is precisely why I don't do it this way...

I maintain quite a few web presences for various types of organisation, and
provide a mailshot facility of which the largest single mailing list has
around 800 addresses. Usually, I set this up to run at around 2am when my
ISP's mail server is at its least busy. Depending on the size of the actual
email, this sends at a rate of between 2 and 4 every second.
 
N

Newbie

clickon said:
You are obviously adding email adresses to the to property of one instance
of
a system.net.mail.smtpclient object and then sending the email. If you
create an instance of the system.net.mail.smtpclient object add the to
address and then send the mail, all in your loop, then it will send
compeltely seperate emails. Alternatively you could try adding recipients
as
BCC addresses as this would scale better, but you would probably have to
use
some spurious address (e.g. do (e-mail address removed)) for the To
address
and this can trigger spam filters.

Thanks for the reply,

Yup, that's what I did exactly. Adding all (not all, actually, about 100
addresses per send) to a single instance.
I've thought about the possibility of only sending one email at a time, then
looping through all the records. I haven't tried it yet, but I thought it
could't take advantage of the async feature.
Anyway, IMO, that's what an async operation has its advantange over a
take-a-long-time operation.

About adding up all the rest of to a single instance's BCC, wouldn't it has
the same effect as adding it all to the TO property?


Many thanks,
Andy
 
M

Mark Rae

About adding up all the rest of to a single instance's BCC, wouldn't it
has the same effect as adding it all to the TO property?

Yes, but each individual recipient would not see all the other recipients'
email addresses - you need to be very aware of this in the UK (and, I'm
sure, in other countries) due to Data Protection laws etc...
 
G

Guest

As Mark says using BCC would hide the other email adresses from the
recipients, that's what it does BCC = blind carbon copy The problem with
doing this is that it is more liekly to be marked as spam by spam filters.

You would lose the advantage of the asynchronous send, but what you have to
bare in mind is how often you are going to email and how many you are going
to send. If you are talking about it taking 2 minutes rather than ten
seconds once a week, the advantages the extra speed advantage is greatly
outwieghed by the advantage of sending individual emails.

It's not always better to write the most effecient code possible, often
there are other factors to take into account.
 
N

Newbie

Thanks Mark, Clickon

I just wonder (please excuse my dumb question, if such :) , Is there any
such thing like 'multi-threaded' email sending for ASP.NET 2.0?
 
N

Newbie

Hi clickon,

I see your point. I just modified my code. Added several recipients at once
to the BCC field. and set my TO field to something phoney (is it what you
really mean?)
But i still can't understand why doing so would trigger the spam filter?
What if i replaced the TO field with something real?


And Mark,
What's about the legal issue you mentioned?

Thanks,
Andy
 
N

Newbie

Sorry guys, but I think the TO field (which will be displayed in all
recipient's emails) has to be a real one. cause the server will has to send
it anyway. if not it will bounced.

Am I correct?

Thanks,
 
M

Mark Rae

Sorry guys, but I think the TO field (which will be displayed in all
recipient's emails) has to be a real one. cause the server will has to
send it anyway. if not it will bounced.

Am I correct?

No.
 
R

Ray Booysen

Newbie said:
Sorry guys, but I think the TO field (which will be displayed in all
recipient's emails) has to be a real one. cause the server will has to send
it anyway. if not it will bounced.

Am I correct?

Thanks,

It doesn't have to be a real one. If the TO: email address doesn't
exist it will still send.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top