异步邮件 [英] Async Mail

查看:91
本文介绍了异步邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在寻找一种方式向我的订阅者发送简报(共1000多个)。

我''我设法使用.NET system.net.mail.smtpclient'的sendAsync来做到这一点。我使用sqldatareader从表(在MSSQL数据库中)中读取电子邮件地址,

然后循环读取每个电子邮件地址并将其添加到

实例''''TO''属性(例如:mail.to.add(r.item(" email_addr")))。


我测试用我自己的地址运行它以查看它是如何工作的。

成功地异步发送它。


有一个小问题我需要一些见解来自你们所有人:发送给的所有

电子邮件地址列在发送的每封

电子邮件的收件人字段中。

假设我发送到5个地址,发送的所有5封电子邮件都在TO字段中发送了5封电子邮件

地址。

我想要什么是:发送的电子邮件中的发送字段只显示一个

地址(收件人的电子邮件地址),以便更加个性化。


关于如何做的任何想法?


非常感谢,

Mike

解决方案

您显然是在一个实例的to属性中添加电子邮件地址

a system.net.mail.smtpclient对象然后发送电子邮件。如果你创建一个system.net.mail.smtpclient对象的实例,那么添加到

地址,然后发送邮件,全部在你的循环中,然后它会发送

强制分开电子邮件。或者你可以尝试添加收件人作为BCC地址,因为这会更好地扩展,但你可能不得不使用

一些虚假地址(例如,做没有******* @ yourdomain.com )To to address

这可以触发垃圾邮件过滤器。


" Newbie"写道:


大家好,


我正在寻找一种方式向我的订阅者发送简讯(1000+)总计)。

我已经设法使用.NET system.net.mail.smtpclient'的sendAsync。我使用sqldatareader从表(在MSSQL数据库中)中读取电子邮件地址,

然后循环读取每个电子邮件地址并将其添加到

实例''''TO''属性(例如:mail.to.add(r.item(" email_addr")))。


我测试用我自己的地址运行它以查看它是如何工作的。

成功地异步发送它。


有一个小问题我需要一些见解来自你们所有人:发送给的所有

电子邮件地址列在发送的每封

电子邮件的收件人字段中。

假设我发送到5个地址,发送的所有5封电子邮件都在TO字段中发送了5封电子邮件

地址。

我想要什么是:发送的电子邮件中的发送字段只显示一个

地址(收件人的电子邮件地址),以便更加个性化。


关于如何做的任何想法?


非常感谢,

Mike


" clickon" < cl ***** @ discussion.microsoft.com写信息

新闻:54 *********************** *********** @ microsof t.com ...


您显然是在一个实例的to属性中添加电子邮件地址



a system.net.mail.smtpclient对象然后发送电子邮件。如果你创建一个system.net.mail.smtpclient对象的实例,那么添加到

地址,然后发送邮件,全部在你的循环中,然后它会发送

强制分开电子邮件。



这就是我做的......


或者你可以尝试添加收件人为

BCC地址因为这会扩展得更好,但你可能需要

使用

一些虚假地址(例如没有******* @ yourdomain.com )To

地址

,这可以触发垃圾邮件过滤器。



这是正确的,这正是我不这样做的原因......


我为各种类型的组织保留了不少网站,并且

提供了一个邮件设施,其中最大的单个邮件列表有大约800个地址的
。通常情况下,我将其设置为凌晨2点左右,当时我的
ISP的邮件服务器处于最不忙的状态。根据实际

电子邮件的大小,每秒发送的速率为2到4之间。




clickon < cl ***** @ discussion.microsoft.com写信息

新闻:54 *********************** *********** @ microsof t.com ...


您显然是在一个实例的to属性中添加电子邮件地址



a system.net.mail.smtpclient对象然后发送电子邮件。如果你创建一个system.net.mail.smtpclient对象的实例,那么添加到

地址,然后发送邮件,全部在你的循环中,然后它会发送

强制分开电子邮件。或者你可以尝试添加收件人

as

BCC地址,因为这会更好地扩展,但你可能需要

使用

一些虚假地址(例如 no*******@yourdomain.com )要

地址

这可以触发垃圾邮件过滤器。



感谢您的回复,


是的,这就是我所做的。将所有(实际上,每次发送约100个

地址)添加到单个实例。

我已经考虑过只能发送一封电子邮件的可能性时间,然后

循环遍历所有记录。我还没有尝试过,但是我认为它不会利用异步功能。

无论如何,IMO,这就是一个什么样的异步操作有利于长期运行。


关于将所有其余部分添加到单个实例中BCC,它不会有和b $ b相同的效果,就像把它全部加到TO属性一样吗?

非常感谢,

Andy


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

解决方案

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


"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.



"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


这篇关于异步邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆