从VB.Net 2003发送电子邮件 [英] Send E-Mail from VB.Net 2003

查看:65
本文介绍了从VB.Net 2003发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用我在这个组中的一个示例发送电子邮件

如下:( toemail和myemail都是有效的电子邮件地址。


''System.Web.Mail''(需要引用System.Web.dll),

'''''delcare一条新邮件

Dim aMailMessage As New System.Web.Mail.MailMessage


''''''设置起始地址

aMailMessage。 From = myemail

''''''设置地址和主题

aMailMessage.To = toemail

aMailMessage.Subject ="测试从VB发送电子邮件。


'''''发送文本格式

aMailMessage.BodyFormat = System.Web.Mail。 MailFormat.Text


'''''设置正文文本

aMailMessage.Body ="这是来自
我的测试程序。


''''''如果你添加一个附件想要

''aMailMessage.Attachments.Add(新

System.Web.Mail.MailAttachment(" C:Test.txt",
$ b) $ b System.Web.Mail.MailEncoding.Base64))


'''''发送电子邮件

System.Web.Mail.SmtpMail。 SmtpServer =" smtp.sbcglobal.net"

System.Web.Mail.SmtpMail.Send(aMailMessage)


我收到一条错误消息,指出无法访问CDO.Message对象。任何人

知道我做错了什么,我的电子邮件是通过RoadRunner互联网连接。

-

Dennis in Houston

I am trying to send an e-mail using one of the examples I got on this group
as follows: (both toemail and myemail are valid e-mail addreses.

''System.Web.Mail'' (requires reference to "System.Web.dll"),
'''''' delcare a new mail message
Dim aMailMessage As New System.Web.Mail.MailMessage

'''''' set the from address
aMailMessage.From = myemail
'''''' set the to address and subject
aMailMessage.To = toemail
aMailMessage.Subject = "Test Sending E-Mail from VB."

'''''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

'''''' set the body text
aMailMessage.Body = "This is the text of the email message from
my test Program."

'''''' add an attachment if you want to
''aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

'''''' send the email
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

I get an error message stating "Could not access CDO.Message Object. Anyone
know what I''m doing wrong, My e-mail is via RoadRunner Internet connection.
--
Dennis in Houston

推荐答案



" Dennis" <德**** @ discussions.microsoft.com>在消息中写道

新闻:6A ********************************** @ microsof t.com ...

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
我收到一条错误消息,指出无法访问CDO.Message对象。
任何人都知道我在做什么错了,我的电子邮件是通过RoadRunner Internet
连接。
I get an error message stating "Could not access CDO.Message Object.
Anyone
know what I''m doing wrong, My e-mail is via RoadRunner Internet
connection.




RoadRunner?垃圾邮件中心?



RoadRunner? Spam Central?


嗨Dennis:


三周前我遇到同样的问题所以如果你的opreating系统是
windows XP


执行以下操作:

1 \转到控制面板,然后转到管理工具,之后如果你没有找到IIS

那就意味着你必须从windows XP CD安装这个组件。
这个叫做Internet信息服务IIS的东西。


2 \当你打开IIS时,转到本地计算机并点击加号你将会发现

名为默认SMTP虚拟服务器的东西,对吧点击并转到

访问标签

点击中继按钮后添加IP地址:127.0.0.1并设置

System.Web.Mail.SmtpMail.SmtpServer =" 127.0.0.1"并且你的问题将是

解决了上帝的意愿,如果你想要更多关于这个错误消息的信息

哪个是家庭的话去

<一个rel =nofollowhref =http://www.systemwebmail.net/faq/4.2.3.aspxtarget =_ blank> http://www.systemwebmail.net/faq/4.2.3.aspx


Husam

" Dennis"写道:
Hi Dennis:

I face the same problem three weeks ago so if your opreating system is
windows XP

do the following:
1\ go to control panel, then go to Administrative Tools , after that go to
something called Internet Information services IIS, if you did not find IIS
that mean you have to install this componant from windows XP CD.

2\ When you Open IIS go to the Local Computer and click plus sign you will
find
something called Default SMTP Virtual Server, right click and go to the
access tab
after that click relay button add IP address this one :"127.0.0.1" and set
System.Web.Mail.SmtpMail.SmtpServer = "127.0.0.1" and your problem will be
solved God willing, If you want more infromation about this error message
which is familire go to

http://www.systemwebmail.net/faq/4.2.3.aspx

Husam
"Dennis" wrote:
我正在尝试使用我在这个组中的一个示例发送电子邮件
如下:( toemail和myemail都是有效的电子邮件addreses。

''System.Web.Mail''(需要引用System.Web.dll),
''''delcare一条新的邮件消息Dim aMailMessage As New System.Web.Mail.MailMessage

'''''设置起始地址
aMailMessage.From = myemail
'''''''设置地址和主题
aMailMessage.To = toemail
aMailMessage.Subject ="测试从VB发送电子邮件。

''''''发送文字格式
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
''''''设置正文文件
aMailMessage.Body ="这是电子邮件的文本来自
我的测试程序的消息。

'''''如果你想要添加附件
'aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment(" C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

''''''发送电子邮件<系统.Web.Mail.SmtpMail.SmtpServer =" smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

我收到一条错误提示声明无法访问CDO.Message对象。任何人都知道我做错了什么,我的电子邮件是通过RoadRunner上网连接的。
-
休斯顿的丹尼斯
I am trying to send an e-mail using one of the examples I got on this group
as follows: (both toemail and myemail are valid e-mail addreses.

''System.Web.Mail'' (requires reference to "System.Web.dll"),
'''''' delcare a new mail message
Dim aMailMessage As New System.Web.Mail.MailMessage

'''''' set the from address
aMailMessage.From = myemail
'''''' set the to address and subject
aMailMessage.To = toemail
aMailMessage.Subject = "Test Sending E-Mail from VB."

'''''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

'''''' set the body text
aMailMessage.Body = "This is the text of the email message from
my test Program."

'''''' add an attachment if you want to
''aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

'''''' send the email
System.Web.Mail.SmtpMail.SmtpServer = "smtp.sbcglobal.net"
System.Web.Mail.SmtpMail.Send(aMailMessage)

I get an error message stating "Could not access CDO.Message Object. Anyone
know what I''m doing wrong, My e-mail is via RoadRunner Internet connection.
--
Dennis in Houston




当我通过vs2003学习邮件时,
i遇到了这个问题。

现在我不记得我做了什么,但我想我''我用微软网站上提供的最新Service Pack更新了我的

操作系统,它启动了

工作。还要检查您的PC上是否有最新版本的IIS以及最新的

Service Pack。因为它可能也需要你的程序。


幸运


i had this problem when i was learning mailing through vs2003.
right now i dont remember what i had done but i think i''ve updated my
OS with latest Service Pack available at Microsoft site and it started
working. also check that you have latest version of IIS with latest
Service Pack on your pc. coz it might also require for your programm.

Lucky


这篇关于从VB.Net 2003发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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