+ InnerException {"邮件无法发送到SMTP服务器。转运 [英] + InnerException {"The message could not be sent to the SMTP server. The transpo

查看:118
本文介绍了+ InnerException {"邮件无法发送到SMTP服务器。转运的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我编写的控制台应用程序中收到此消息,我正在验证,我的网络管理员发誓他们的

smtp服务器并没有错。有什么想法吗?


public void Mail_update()

{

试试

{

System.Web.Mail.MailMessage TME = new MailMessage();

TME.To =" ad ********** @ hotmail.com" ;;

TME.From =" Da ********* @ QedData.com";

TME.Body ="< HTML>< HEAD>< TITLE> Scholastic需要你的

帮助< / TITLE>< / HEAD>< BODY lang = EN-US vLink = blue link = blue>< DIV lang = en-us

dir = ltr align = left>< FONT face = \" Times New Roman \" size = 3>< SPAN style = \" FONT-

SIZE:12pt \">< o:p>& nbsp;< / o:p>< / SPAN>< / FONT>< / DIV>" ;;

TME.Body + ="< DIV>< P style = \" TEXT-ALIGN:center \" align = center>< FONT

face = \" Times New Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">< IMG

id = _x0000_i1025 height = 21 src = \" http:/ /www.hellerreports.com/RedBar.jpg\"

width = 154 border = 0 NOSEND = \" 1 \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"

align = center>< B>< FONT face = Arial size = 3>< SPAN style = \" FONT-WEIGHT:bold; FONT-

尺寸:12pt; FONT-FAMILY:Arial \"> Scholastic需要你的帮助!

< / SPAN>< / FONT>< / B>< o:p>< / o: p>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0 in 0pt; TEXT-ALIGN:center \"

align = center>< B>< FONT face = Arial size = 3>< SPAN style = \" FONT-WEIGHT:bold; FONT-

尺寸:12pt; FONT-FAMILY:Arial \>确保您学校的信息达到
日期。< / SPAN>< / FONT>< / B>< ; o:p>< / o:p>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \\">< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" > < SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">< SPAN& nbsp;< / SPAN>< SPAN style = \" FONT-SIZE:10pt \

"> ;< o:p>< / o:p>< / SPAN>< / P>" ;;

TME.Body + ="< P style = \" ; MARGIN:0in 0in 0pt \">< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< FONT face = Arial

size = 2>< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:Arial \">亲爱的学校

秘书,< / SPAN>< / FONT>< o:p>< / o:p>< / P> ;         

Roman \ size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \"> Scholastic和QED希望确保我们的记录

是最新的,需要你的帮助!& nbsp;& nbsp;我们的记录显示在

上周,以下教师已加入你的员工< / SPAN>:

< SPAN style = \FONT-SIZE:10pt \\ &&;>< o:p>< / o:p>< / SPAN>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< FONT face = \" Times New

Roman \" size = 2>< SPAN style = \" FONT-SIZE:10pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">< / SPAN>< / SPAN>& nbsp;< / P>" ;;


for(int x = 0; x< sendFirstName.Length; x ++)

{

TME.Body + ="< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:Arial \">" +

sendFirstName [x] +" " +"< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:Arial \

">" + sendLastName [x] +"< br>";

}

TME.Body + ="< P style = \" MARGIN: 0in 0in 0pt \">< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" > < SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">< SPAN& nbsp;< / SPAN>< SPAN style = \" FONT-SIZE:10pt \

"> ;< o:p>< / o:p>< / SPAN>< / P>" ;;

TME.Body + ="<![if!supportLists] ><![endif]><![if!supportLists]><![endif]

I am receiving this messaage in a console application I wrote, I am
authenticating, and my network admin swears their is nothing wrong with the
smtp server. Any ideas?

public void Mail_update()
{
try
{
System.Web.Mail.MailMessage TME = new MailMessage();
TME.To = "ad**********@hotmail.com";
TME.From = "Da*********@QedData.com";
TME.Body ="<HTML><HEAD><TITLE>Scholastic Needs Your
Help</TITLE></HEAD><BODY lang=EN-US vLink=blue link=blue><DIV lang=en-us
dir=ltr align=left><FONT face=\"Times New Roman\"size=3><SPAN style=\"FONT-
SIZE: 12pt\"><o:p>&nbsp;</o:p></SPAN></FONT></DIV>";
TME.Body += "<DIV><P style=\"TEXT-ALIGN: center\" align=center><FONT
face=\"Times New Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\"><IMG
id=_x0000_i1025 height=21 src=\"http://www.hellerreports.com/RedBar.jpg\"
width=154 border=0 NOSEND=\"1\"><o:p></o:p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt; TEXT-ALIGN: center\"
align=center><B><FONT face=Arial size=3><SPAN style=\"FONT-WEIGHT: bold; FONT-
SIZE: 12pt; FONT-FAMILY: Arial\">Scholastic Needs Your Help!
</SPAN></FONT></B><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt; TEXT-ALIGN: center\"
align=center><B><FONT face=Arial size=3><SPAN style=\"FONT-WEIGHT: bold; FONT-
SIZE: 12pt; FONT-FAMILY: Arial\">Make sure your school''s information is up-to-
date.</SPAN></FONT></B><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"> <SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"><SPAN &nbsp;</SPAN><SPAN style=\"FONT-SIZE: 10pt\
"><o:p></o:p></SPAN></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=Arial
size=2><SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY: Arial\">Dear School
Secretary,</SPAN></FONT><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\">Scholastic and QED want to make sure our records
are current and need your help!&nbsp;&nbsp;Our records indicate that over the
last week the following&nbsp;teachers have&nbsp;joined your staff</SPAN>:
<SPAN style=\"FONT-SIZE: 10pt\"><o:p></o:p></SPAN></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=2><SPAN style=\"FONT-SIZE: 10pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"></SPAN></SPAN>&nbsp;</P>";

for(int x = 0; x < sendFirstName.Length; x++)
{
TME.Body += "<SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY: Arial\">" +
sendFirstName[x] + " " + "<SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY: Arial\
">" + sendLastName[x]+"<br>";
}
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"> <SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"><SPAN &nbsp;</SPAN><SPAN style=\"FONT-SIZE: 10pt\
"><o:p></o:p></SPAN></P>";
TME.Body += "<![if !supportLists]><![endif]><![if !supportLists]><![endif]

< P style = \" MARGIN:0 in 0in 0pt \ ">< FONT face = \" Times New Roman \" size = 2>< SPAN
<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New Roman\" size=2><SPAN



style = \" FONT-SIZE:10pt \">& nbsp;< o:p>< / o :p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">请回复此邮件,并告知我们上面的教师是否正在替换那些已经搬过的老师。& nbsp;我们

感谢您的帮助,并希望确保您的学校能够以最及时,最准确的方式继续获得

订单和信息。

& nbsp;< / SPAN>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \\">< SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">< / SPAN>& nbsp;< / P>" ;;

TME.Body + ="< P style = \ " MARGIN:0in 0in 0pt \">< SPAN style = \" FONT-SIZE:

10pt; FONT-FAMILY:Arial \">& nbsp;< / SPAN>我们感谢您的帮助,因为我们努力为您提供更好的服务。< / SPAN>< SPAN style = \FONT-SIZE:10pt \">< o:p>< / o:

p>< / SPAN>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New

Roman \ size = 2>< SPAN style = \" FONT-SIZE:10pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0 in 0 in 0pt \" >< FONT face = \" Times New

Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:

p>< ; / / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0 in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = \" Times New Roman \" size = 2>< SPAN style = \" FONT-SIZE:

10pt \">< IMG id = _x0000_i1026 height = 47 src = \"

http://www.hellerreports.com/red.jpg\" width = 72 border = 0 NOSEND = \" 1 \

">< / SPAN>< / FONT>< FONT size = 1>< SPAN Style = \\ \\FONT-SIZE:8pt \">< o:p>< / o:

p>< / SPAN>< / FONT>< / P> " ;;

TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-

家庭:Arial \">优质教育数据< / SPAN>< / FONT>< FONT size = 1>< SPAN style = \

FONT-SIZE:8pt \>< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-

家庭:Arial \"> 1625 Broadway,Suite 250< / SPAN>< / FONT>< FONT size = 1>< SPAN

style = \" FONT-SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-

FAMILY:Arial \"> Denver,CO 80202< / SPAN>< / FONT>< FONT size = 1>< SPAN style = \FONT-

SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-

FAMILY:Arial \"> 800.525.5811< / SPAN>< / FONT>< FONT size = 1>< SPAN style = \" FONT-

SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"

align = center>< FONT face = \" Times New Roman \" size = 1>< SPAN style = \" FONT-SIZE:

8pt \">& nbsp;< o:p>< / o:p>< ; / SPAN>< / FONT>< / P>" ;;

TME.Body + ="< P style = \" TEXT-ALIGN:center \" align = center>< FONT

face = Arial size = 1>< SPAN style = \" FONT-SIZE:7.5pt; FONT-FAMILY:Arial \

"> ________________________________________________ _________< BR>您正在使用

质量教育数据(QED)电子邮件列表。要将您的电子邮件地址从< BR>质量教育数据(QED)中删除

列表,请

回复此邮件并放置\ ; Remove\"在主题行中。

< / SPAN>< / FONT>" ;;

TME.Body + ="< FONT face = Arial>< SPAN style = \" FONT-FAMILY:Arial \">< o:p>< / o:

p>< / SPAN>< / FONT>< ; / P>< / DIV>< P align = center>& nbsp;< / P>< / BODY>< / HTML>" ;;

TME.Subject = Scholastic需要你的帮助;

TME.BodyFormat = System.Web.Mail.MailFormat.Html;

System.Web.Mail.SmtpMail.SmtpServer =" Bizmail.Scholastic.com" ;;

TME.Fields.Add("

http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ;," 1");

TME.Fields.Add("

http://schemas.microsoft.com/cdo/configuration/sendusername"," Data_Update") ;

TME.Fields.Add("

http://schemas.microsoft.com/cdo/configuration/sendpassword" ;,Welcome1");

System.Web.Mail.SmtpMail.Send(TME);

}

catch(System.Exception e)

{

System.Console.WriteLine(e.Message);

}

}

-

通过DotNetMonster.com发布消息
http://www.dotnetmonster.com/Uwe/For。 ..sharp / 200511/1

推荐答案

您可以发布完整的
而不是发布所有HTML代码
异常消息?主题行中的信息被截断。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" ahager via DotNetMonster.com" < u14368 @乌韦>写在消息中

新闻:56c580742eec1 @ uwe ...
Instead of posting all of the HTML code, could you post the complete
exception message? The information in the subject line was cut off.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ahager via DotNetMonster.com" <u14368@uwe> wrote in message
news:56c580742eec1@uwe...
我在我写的控制台应用程序中收到此消息,我正在验证,我的网络管理员发誓他们的
smtp服务器是没有错的。有什么想法吗?

public void Mail_update()
{
尝试
{System /Web.Mail.MailMessage TME = new MailMessage();
TME.To =" ad ********** @ hotmail.com" ;;
TME.From =" Da ********* @ QedData.com" ;;
TME.Body ="< HTML>< HEAD>< TITLE> Scholastic需要您的
帮助< / TITLE>< / HEAD>< BODY lang = EN-US vLink = blue link = blue>< DIV lang = en-us
dir = ltr align = left>< FONT face = \" Times New Roman \" size = 3>< SPAN
style = \" FONT-
SIZE:12pt \">< o:p>& nbsp;< / o:p>< / SPAN>< / FONT> < / DIV>" ;;
TME.Body + ="< DIV>< P style = \" TEXT-ALIGN:center \" align = center>< FONT
face = \" Times New Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">< IMG
id = _x0000_i1025 height = 21 src = \" http://www.hellerreports .com / RedBar.jpg \"
width = 154 border = 0 NOSEND = \" 1 \">< o:p>< / o:p>< / SPAN> ;< / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt; TEXT-ALIGN:center \"
align = center>< B>< FONT face = Arial size = 3>< SPAN style = \" FONT-WEIGHT:bold;
FONT-
SIZE:12pt; FONT-FAMILY:Arial \"> Scholastic需要你的帮助!
< / SPAN>< / FONT>< / B>< o:p>< / o:p>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt; TEXT-ALIGN:center \"
align = center>< B>< FONT face = Arial size = 3>< SPAN style = \" FONT-WEIGHT:bold;
FONT-
SIZE:12pt; FONT-FAMILY:Arial \">确保您学校的信息是
最新日期。< / SPAN>< / FONT>< / B>< ; o:p>< / o:p>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \"> ;< FONT face = \" Times New
Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt \"> < SPAN style = \" FONT-SIZE:
10pt; FONT-FAMILY:Arial \">< SPAN& nbsp;< / SPAN>< SPAN style = \" FONT-SIZE:
10pt\
"> ;< o:p>< / o:p>< / SPAN>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New
Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = Arial
size = 2>< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:Arial \">亲爱的学校
秘书,< / SPAN>< / FONT>< o:p>< / o:p>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New
Roman \" ; size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \\ \\Times New
Roman \ size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt \">< SPAN style = \\ \\FONT-SIZE:
10pt; FONT-FAMILY:Arial \"> Scholastic和QED希望确保我们的
记录是最新的,需要你的帮助!& nbsp;& nbsp;我们的记录表明上周,以下教师已加入您的员工< / SPAN>:
< SPAN style = \FONT-SIZE:10pt \"> ;< o:p>< / o:p>< / SPAN>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New
Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \\ \\Times New
Roman \ size = 2>< SPAN style = \" FONT-SIZE:10pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt \">< SPAN style = \\ \\FONT-SIZE:
10pt; FONT-FAMILY:Arial \">< / SPAN>< / SPAN>& nbsp;< / P>" ;;

for(int x = 0; x< ; sendFirstName.Length; x ++)
{/> TME.Body + ="< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:Arial \">" +
sendFirstName [x] +" " +"< SPAN style = \" FONT-SIZE:10pt; FONT-FAMILY:


">" + sendLastName [x] +"< br>" ;;
}
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \"> ;< FONT face = \" Times New
Roman \" size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt \"> < SPAN style = \" FONT-SIZE:
10pt; FONT-FAMILY:Arial \">< SPAN& nbsp;< / SPAN>< SPAN style = \" FONT-SIZE:
10pt\
"> ;< o:p>< / o:p>< / SPAN>< / P>" ;;
TME.Body + ="<![if!supportLists]>< ![endif]><![if!supportLists]><![endif]
I am receiving this messaage in a console application I wrote, I am
authenticating, and my network admin swears their is nothing wrong with
the
smtp server. Any ideas?

public void Mail_update()
{
try
{
System.Web.Mail.MailMessage TME = new MailMessage();
TME.To = "ad**********@hotmail.com";
TME.From = "Da*********@QedData.com";
TME.Body ="<HTML><HEAD><TITLE>Scholastic Needs Your
Help</TITLE></HEAD><BODY lang=EN-US vLink=blue link=blue><DIV lang=en-us
dir=ltr align=left><FONT face=\"Times New Roman\"size=3><SPAN
style=\"FONT-
SIZE: 12pt\"><o:p>&nbsp;</o:p></SPAN></FONT></DIV>";
TME.Body += "<DIV><P style=\"TEXT-ALIGN: center\" align=center><FONT
face=\"Times New Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\"><IMG
id=_x0000_i1025 height=21 src=\"http://www.hellerreports.com/RedBar.jpg\"
width=154 border=0 NOSEND=\"1\"><o:p></o:p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt; TEXT-ALIGN: center\"
align=center><B><FONT face=Arial size=3><SPAN style=\"FONT-WEIGHT: bold;
FONT-
SIZE: 12pt; FONT-FAMILY: Arial\">Scholastic Needs Your Help!
</SPAN></FONT></B><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt; TEXT-ALIGN: center\"
align=center><B><FONT face=Arial size=3><SPAN style=\"FONT-WEIGHT: bold;
FONT-
SIZE: 12pt; FONT-FAMILY: Arial\">Make sure your school''s information is
up-to-
date.</SPAN></FONT></B><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"> <SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"><SPAN &nbsp;</SPAN><SPAN style=\"FONT-SIZE:
10pt\
"><o:p></o:p></SPAN></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=Arial
size=2><SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY: Arial\">Dear School
Secretary,</SPAN></FONT><o:p></o:p></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\">Scholastic and QED want to make sure our
records
are current and need your help!&nbsp;&nbsp;Our records indicate that over
the
last week the following&nbsp;teachers have&nbsp;joined your staff</SPAN>:
<SPAN style=\"FONT-SIZE: 10pt\"><o:p></o:p></SPAN></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=2><SPAN style=\"FONT-SIZE: 10pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"></SPAN></SPAN>&nbsp;</P>";

for(int x = 0; x < sendFirstName.Length; x++)
{
TME.Body += "<SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY: Arial\">" +
sendFirstName[x] + " " + "<SPAN style=\"FONT-SIZE: 10pt; FONT-FAMILY:
Arial\
">" + sendLastName[x]+"<br>";
}
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New
Roman\" size=3><SPAN style=\"FONT-SIZE: 12pt\">&nbsp;<o:p></o:
p></SPAN></FONT></P>";
TME.Body += "<P style=\"MARGIN: 0in 0in 0pt\"> <SPAN style=\"FONT-SIZE:
10pt; FONT-FAMILY: Arial\"><SPAN &nbsp;</SPAN><SPAN style=\"FONT-SIZE:
10pt\
"><o:p></o:p></SPAN></P>";
TME.Body += "<![if !supportLists]><![endif]><![if !supportLists]><![endif]
< P style = \" MARGIN:0 in 0in 0pt \"> < FONT face = \" Times New Roman \"
size = 2>< SPAN
<P style=\"MARGIN: 0in 0in 0pt\"><FONT face=\"Times New Roman\"
size=2><SPAN


style = \" FONT-SIZE:10pt \" >& nbsp;< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0 in 0pt \">< SPAN style = \FONT-SIZE:
10pt; FONT-FAMILY:Arial \">请回复此邮件,并告知我们上述教师是否正在取代已经搬迁的教师。& nbsp;我们非常感谢您的帮助,并希望确保您的学校继续以最及时,最准确的方式接收订单和信息。
& ;&n ;;< / SPAN>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0 in 0in 0pt \">< SPAN style = \" FONT-SIZE:
10pt; FONT-FAMILY:Arial \">< / SPAN>& nbsp;< / P>" ;;
TME.Body + ="< P style = \" MARGIN: 0in 0in 0pt \">< SPAN style = \" FONT-SIZE:
10pt; FONT-FAMILY:Arial \">& nbsp;< / SPAN>我们感谢您的帮助,因为我们的工作
为您提供更好的服务。< / SPAN>< SPAN style = \FONT-SIZE:10pt \">< o:p>< / o:
p>< / SPAN>< / P>" ;;
TME .Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \" Times New
Roman \" size = 2>< SPAN style = \" FONT-SIZE:10pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \\ \\Times New
Roman \ size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt \">< FONT face = \\ \\Times New
Roman \ size = 3>< SPAN style = \" FONT-SIZE:12pt \">& nbsp;< o:p>< / o:
p>< / SPAN> < / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = \" Times New Roman \" size = 2>< SPAN
style = \" FONT-SIZE:
10pt \">< IMG id = _x0000_i1026 height = 47 src = \"
http://www.hellerreports.com/red.jpg\" width = 72 border = 0 NOSEND = \" 1 \
">< / SPAN>< / FONT>< FONT size = 1>< SPAN Style = \" FONT -SIZE:8pt \">< o:p>< / o:
p>< / SPAN>< / FONT>< / P>" ;;
TME .Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-
FAMILY:Arial \"> Quality Education Data< / SPAN>< / FONT>< FONT size = 1>< SPAN
style = \
" ; FONT-SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;
TME.Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-
家庭:Arial \"> 1625 Broadway,Suite 250< / SPAN>< / FONT>< FONT size = 1>< SPAN
style = \" FONT -SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;
TME.Body + = "< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-
FAMILY:Arial \"> Denver,CO 80202< / SPAN>< / FONT>< FONT size = 1>< SPAN
style = \FONT-
SIZE:8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;
TME。 Body + ="< P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = Arial size = 1>< SPAN style = \" FONT-SIZE:8pt; FONT-
FAMILY:Arial \"> 800.525.5811< / SPAN>< / FONT>< FONT size = 1>< SPAN style = \" FONT-
SIZE :8pt \">< o:p>< / o:p>< / SPAN>< / FONT>< / P>" ;;
TME.Body + =" < P style = \" MARGIN:0in 0in 0pt; TEXT-ALIGN:center \"
align = center>< FONT face = \" Times New Roman \" size = 1>< SPAN
style = \" FONT-SIZE:
8pt \">& nbsp;< o:p>< / o:p>< ; / / SPAN>< / FONT>< / P>" ;;
TME.Body + ="< P style = \" TEXT-ALIGN:center \" align = center>< FONT
face = Arial size = 1>< SPAN style = \" FONT-SIZE:7.5pt; FONT-FAMILY:Arial \
"> ________________________________________________ _________< BR>您正在使用
优质教育数据(QED)电子邮件列表。要将您的电子邮件地址从< BR>质量教育数据(QED)的未来邮件列表中删除,请
回复此邮件并将\删除\在主题行中。
< / SPAN>< / FONT>" ;;
TME.Body + ="< FONT face = Arial>< SPAN style = \" FONT -FAMILY:Arial \">< o:p>< / o:
p>< / SPAN>< / FONT>< / P>< / DIV>< P align = center>& nbsp;< / P>< / BODY>< / HTML>" ;;

TME.Subject =" Scholastic需要你的帮助" ;;
TME.BodyFormat = System.Web.Mail.MailFormat.Html;
System.Web.Mail.SmtpMail.SmtpServer =" Bizmail.Scholastic.com";
TME.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ;," 1");
TME.Fields.Add("
http://schemas.microsoft。 com / cdo / configuration / sendusername",
" Data_Update");
TME.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendpassword" ;,欢迎1);

System.Web.Mail.SmtpMail.Send(TME);
}
catch(System.Exception e)
{ <无线电通信/> System.Console.WriteLine(e.Message);
}
}

-
通过DotNetMonster.com发布的消息
http://www.dotnetmonster.com/Uwe/For ... sharp / 200511/1



内部异常是邮件无法发送到SMTP服务器。

传输错误代码是0x80040217。服务器响应不可用


Nicholas Paldino [.NET / C#MVP]写道:
The inner exception is "The message could not be sent to the SMTP server. The
transport error code was 0x80040217. The server response was not available"

Nicholas Paldino [.NET/C# MVP] wrote:
而不是发布所有HTML代码,你能发帖吗?完整的
异常消息?主题行中的信息被截断。
Instead of posting all of the HTML code, could you post the complete
exception message? The information in the subject line was cut off.
我在我写的控制台应用程序中收到此消息,我正在验证,我的网络管理员发誓他们什么都不是错误的
I am receiving this messaage in a console application I wrote, I am
authenticating, and my network admin swears their is nothing wrong with


[引用文字剪辑 - 164行]


[quoted text clipped - 164 lines]

}
}



-

通过DotNetMonster.com发布消息
http://www.dotnetmonster.com/Uwe/For...sharp/200511/1


你们是否设置了本地SMTP服务器?你需要这个来发送

消息,我相信。


您可能想要考虑Indy项目,因为它有类

没有这个要求。


另外,如果你使用的是.NET 2.0,你可以使用

中的类System.Net .Mail命名空间,也没有这个要求。

-

- Nicholas Paldino [.NET / C#MVP]

- < a href =mailto:mv*@spam.guard.caspershouse.com> mv*@spam.guard.caspershouse.com


" ahager via DotNetMonster。 COM" < u14368 @乌韦>写在消息中

news:56c5a423526ef @ uwe ...
Do you have a local SMTP server set up? You need this in order to send
messages, I believe.

You might want to consider the Indy Project, as it has classes that do
not have this requirement.

Also, if you are using .NET 2.0, you can use the classes in the
System.Net.Mail namespace, which do not have this requirement either.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ahager via DotNetMonster.com" <u14368@uwe> wrote in message
news:56c5a423526ef@uwe...
内部异常是消息无法发送到SMTP服务器。

传输错误代码是0x80040217。服务器响应不可用

Nicholas Paldino [.NET / C#MVP]写道:
The inner exception is "The message could not be sent to the SMTP server.
The
transport error code was 0x80040217. The server response was not
available"

Nicholas Paldino [.NET/C# MVP] wrote:
而不是发布所有HTML代码,你能发帖吗?完整的
异常消息?主题行中的信息被截断。
Instead of posting all of the HTML code, could you post the complete
exception message? The information in the subject line was cut off.
我在我写的控制台应用程序中收到此消息,我正在验证,我的网络管理员发誓他们什么都不是错误的
I am receiving this messaage in a console application I wrote, I am
authenticating, and my network admin swears their is nothing wrong with


[引用文字剪辑 - 164行]


[quoted text clipped - 164 lines]

}
}



-
通过DotNetMonster.com发布的消息
http://www.dotnetmonster.com/Uwe/For...sharp/200511/1



这篇关于+ InnerException {&quot;邮件无法发送到SMTP服务器。转运的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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