问题清除在电子邮件程序中发送错 [英] Problem clearing send error in email program

查看:61
本文介绍了问题清除在电子邮件程序中发送错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用System.Net.Mail发送带有程序的电子邮件组。我

不清除MailMessage但反复循环更改Bcc

条目。如果所有地址都有效,则工作正常。作为一个简单的测试我试图发送一个有效的地址,然后是一个无效的地址,我的ISP(康卡斯特)将立即拒绝不是我们的客户。我

捕获异常,显示然后继续循环发送几个

附加有效。所有余额都被抓住了。并显示一个

错误,但它们已被发送。我对异常的了解微不足道

但怀疑我需要清除。


循环通过以下更改bcc

尝试

smtpobject.Send(MyMailMsg)

Catch ex as Exception

msgbox(ex.tostring)

结束尝试


像往常一样欣赏,


Ed

Trying to send groups of email with program using System.Net.Mail. I
do not clear MailMessage but repeatedly loop changing only the Bcc
entries. Works fine if all addresses are valid. As a simple test I
have attempted to send a valid address, then an invalid address which
my ISP (Comcast) will reject immediately as "Not our customer". I
catch the exception, display and then continue looping to send several
additional valid. The balance all are "caught" and display the an
error but they are sent. I have negligible knowledge of exceptions
but suspect I need to clear.

loop through the following changing only the bcc
try
smtpobject.Send(MyMailMsg)
Catch ex as Exception
msgbox(ex.tostring)
end try

Appreciate as usual,

Ed

推荐答案

Ed Bitzer写道:
Ed Bitzer wrote:

尝试使用System.Net.Mail发送带有程序的电子邮件组。我

不清除MailMessage但反复循环更改Bcc

条目。如果所有地址都有效,则工作正常。作为一个简单的测试我试图发送一个有效的地址,然后是一个无效的地址,我的ISP(康卡斯特)将立即拒绝不是我们的客户。我

捕获异常,显示然后继续循环发送几个

附加有效。所有余额都被抓住了。并显示一个

错误,但它们已被发送。我对异常的了解微不足道

但怀疑我需要清除。


循环通过以下更改bcc

尝试

smtpobject.Send(MyMailMsg)

Catch ex as Exception

msgbox(ex.tostring)

结束尝试


像往常一样欣赏,


Ed
Trying to send groups of email with program using System.Net.Mail. I
do not clear MailMessage but repeatedly loop changing only the Bcc
entries. Works fine if all addresses are valid. As a simple test I
have attempted to send a valid address, then an invalid address which
my ISP (Comcast) will reject immediately as "Not our customer". I
catch the exception, display and then continue looping to send several
additional valid. The balance all are "caught" and display the an
error but they are sent. I have negligible knowledge of exceptions
but suspect I need to clear.

loop through the following changing only the bcc
try
smtpobject.Send(MyMailMsg)
Catch ex as Exception
msgbox(ex.tostring)
end try

Appreciate as usual,

Ed



它在我看来像如果有异常,您需要重置MyMailMsg。

异常将不会在try块结束后持续存在。

It looks to me like you need to reset MyMailMsg if there is an exception. The
exception will not persist past the end of the try block.


Ed,


你能展示完整的循环吗,因为在我的想法中,这不是你问题的基础。


Cor

Ed,

Can you show the full loop, because in my idea can this not be the base of
your problem.

Cor


2008年2月18日星期一21:53:33 -0500,Ed Bitzer写道:
On Mon, 18 Feb 2008 21:53:33 -0500, Ed Bitzer wrote:

试图发送群组使用System.Net.Mail通过程序发送电子邮件。我

不清除MailMessage但反复循环更改Bcc

条目。如果所有地址都有效,则工作正常。作为一个简单的测试我试图发送一个有效的地址,然后是一个无效的地址,我的ISP(康卡斯特)将立即拒绝不是我们的客户。我

捕获异常,显示然后继续循环发送几个

附加有效。所有余额都被抓住了。并显示一个

错误,但它们已被发送。我对异常的了解微不足道

但怀疑我需要清除。


循环通过以下更改bcc

尝试

smtpobject.Send(MyMailMsg)

Catch ex as Exception

msgbox(ex.tostring)

结束尝试


像往常一样欣赏,


Ed
Trying to send groups of email with program using System.Net.Mail. I
do not clear MailMessage but repeatedly loop changing only the Bcc
entries. Works fine if all addresses are valid. As a simple test I
have attempted to send a valid address, then an invalid address which
my ISP (Comcast) will reject immediately as "Not our customer". I
catch the exception, display and then continue looping to send several
additional valid. The balance all are "caught" and display the an
error but they are sent. I have negligible knowledge of exceptions
but suspect I need to clear.

loop through the following changing only the bcc
try
smtpobject.Send(MyMailMsg)
Catch ex as Exception
msgbox(ex.tostring)
end try

Appreciate as usual,

Ed



Ed,


发布整个循环的副本。有一些方法可以构建循环

和错误处理程序对异常更加健壮

-
http://www.thinkersroom.com/bytes


这篇关于问题清除在电子邮件程序中发送错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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