473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Async Mail

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
Aug 14 '06 #1
10 1646
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 no*******@yourdomain.com) for the To address
and this can trigger spam filters.

"Newbie" wrote:
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
Aug 14 '06 #2
"clickon" <cl*****@discussions.microsoft.comwrote in message
news:54**********************************@microsof t.com...
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 no*******@yourdomain.com) 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.
Aug 14 '06 #3

"clickon" <cl*****@discussions.microsoft.comwrote in message
news:54**********************************@microsof t.com...
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 no*******@yourdomain.com) 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
Aug 14 '06 #4
"Newbie" <ad***@infoteknika.comwrote in message
news:u0**************@TK2MSFTNGP02.phx.gbl...
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...
Aug 14 '06 #5
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.

"Newbie" wrote:
>
"clickon" <cl*****@discussions.microsoft.comwrote in message
news:54**********************************@microsof t.com...
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 no*******@yourdomain.com) 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
Aug 14 '06 #6
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?
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:eY**************@TK2MSFTNGP05.phx.gbl...
"Newbie" <ad***@infoteknika.comwrote in message
news:u0**************@TK2MSFTNGP02.phx.gbl...
>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...

Aug 14 '06 #7
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
Aug 14 '06 #8
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,
Aug 14 '06 #9
"Newbie" <ad***@infoteknika.comwrote in message
news:uO**************@TK2MSFTNGP05.phx.gbl...
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.
Aug 14 '06 #10
Newbie wrote:
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.
Aug 14 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Passynkov, Vadim | last post by:
I am using Asynchronous Query Processing interface from libpq library. And I got some strange results on Solaris My test select query is 'SELECT * from pg_user;' and I use select system...
10
by: Shawn Meyer | last post by:
Hello - I am trying to write a class that has an async BeginX and EndX, plus the regular X syncronous method. Delegates seemed like the way to go, however, I still am having problems getting...
4
by: Max | last post by:
Just a simple question, can I run an asyc process on the server (with ASP.NET) for hours at a time to do things like send bulk emails? Are there some restrictions and timeouts that are set by the...
2
by: Lucas Tam | last post by:
Is there a realistic maximum time a client can wait for an async response from a web service? I have requests that may take anywhere from 1 - 5 minutes to complete... maybe even more. Is it safe...
8
by: TS | last post by:
Im in a web page and call an asynchronous method in business class. the call back method is in the web page. When page processes, it runs thru code begins invoking the method then the page...
0
by: Manfred Braun | last post by:
Hi All, I have a problem reading queue-messages async. My QueueReader has a Start() and a Stop() method and if my app starts, it calls Start(). The problem is, that there are possibly several...
6
by: Shak | last post by:
Hi all, Three questions really: 1) The async call to the networkstream's endread() (or even endxxx() in general) blocks. Async calls are made on the threadpool - aren't we advised not to...
10
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under...
1
by: jaffarkazi | last post by:
Hi I have a page that is going to send a number of emails that will be fetched from the database. This is on a hosted server, so I don't have any background automatic way of sending mail. (If...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.