使用C#发送电子邮件 - 退出代码为0 [英] sending email using C# - exited with code 0

查看:82
本文介绍了使用C#发送电子邮件 - 退出代码为0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题 - 我有以下代码发送电子邮件,我引用了Microsoft CDO Library 2000.

它不会在控制台窗口中抛出任何异常。它成功地贯穿整个代码,但我没有收到任何电子邮件。

当我执行此代码发送电子邮件时,它会出现以下错误 -

展开 | 选择 | Wrap | 行号

解决方案

提示:当您在撰写问题时,工具栏上有一个按钮将[code]标签包装在您的复制/粘贴代码周围。它有助于一堆。它的按钮上有一个''#''。 有关标签的更多信息。他们很酷。 Check''em出来。



当我执行此代码发送电子邮件时,它会出现以下错误 -



您显示为错误的内容并非错误。它只是应用程序运行的历史。


我怀疑你只是从某个地方复制/粘贴一大堆代码并期望它能够正常工作。


你缺少许多''使用''陈述。

尊重许多对象,如CDO,如图所示,根本不存在。

当控制台命中第54行时,控制台输出了什么异常错误?


我只看了你帖子的标题..

"使用发送电子邮件C# - 退出代码0"


您认为此消息是否表示错误?

这是您在Visual Studio中构建的第一个程序吗?

I have a question - I have this code below to send an email and I have referenced the Microsoft CDO Library 2000.
It doesn''t throw any exception in the console window. It goes throughout the code successfully, but I do not receive any email.
When I execute this code to send email, it gives the following error -

Expand|Select|Wrap|Line Numbers

解决方案

TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a ''#'' on it. More on tags. They''re cool. Check''em out.


When I execute this code to send email, it gives the following error -

What you show as an error isn''t an error. Its just the history of the application running.

I suspect you just copy/pasted a big chuck of code from someplace and expected it to work.

You are lacky many ''using'' statements.
Have reverenced many objects such as CDO that simply don''t exist in the program as shown.
What did the console output as the exception error when it hit line 54?


I just looked at the title of your post..
"sending email using C# - exited with code 0"

Do you think this message indicates an error?
Is this the first program you''ve built in Visual Studio?


这篇关于使用C#发送电子邮件 - 退出代码为0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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