System.Web.Mail命名空间? [英] System.Web.Mail namespace?

查看:58
本文介绍了System.Web.Mail命名空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试使用该代码创建一个基本的SMTP邮件发件人,

我正在使用VB.NET 2005" express"但这个命名空间是不被识别的......

(system.web.MAIL)


我只允许在该命名空间下声明" system.web":


System.Wb.AspNetHostingPermission

System.Web.AspNetHostingPermissionAttribute

System.Web.AspNetHostingPermissionLevel

Imports System.Web.mail

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e

As System.EventArgs)处理Button1点击


尝试

Dim insMail As New System。()

with insMail

。 From =" om *********** @ gmail.com"

.To =" om *********** @ gmail.com" ;

.Subject =" test"

.Body =" test sending email"

结束

SmtpMail.SmtpServer =你的smtp服务器

SmtpMail.Send(insMail)

Console.WriteLine(成功发送电子邮件消息+

vbCrLf)

Catch err As Exception

MsgBox(无法发送邮件,MsgBoxStyle.Critical,

错误)

结束尝试

结束子

但是,快递是否有限制版本还是那么

编码有什么问题?


谢谢......

Hello, I''m trying to create a basic SMTP mail sender using that code,
i''m using VB.NET 2005 "express" but this namespace wasn''t recognized...
(system.web.MAIL)

I''m only allowed to declare under that namespaces with "system.web":

System.Wb.AspNetHostingPermission
System.Web.AspNetHostingPermissionAttribute
System.Web.AspNetHostingPermissionLevel
Imports System.Web.mail
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

Try
Dim insMail As New System.()
With insMail
.From = "om***********@gmail.com"
.To = "om***********@gmail.com"
.Subject = "test"
.Body = "test sending email"
End With
SmtpMail.SmtpServer = "your smtp server"
SmtpMail.Send(insMail)
Console.WriteLine("Successfully sent email message" +
vbCrLf)
Catch err As Exception
MsgBox("Couldn''t send mail", MsgBoxStyle.Critical,
"Error")
End Try
End Sub
However, is there a limitation for "express" version or is there
something wrong about coding?

Thanks...

推荐答案

kimiraikkonen< ki ************* @ gmail.comwrote

新闻:11 ********* ************@k35g2000prh.googlegro ups.com:
kimiraikkonen <ki*************@gmail.comwrote in
news:11*********************@k35g2000prh.googlegro ups.com:

Imports System.Web.mail

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e

As System.EventArgs)处理Button1.Click


试试

Dim insMail as New System。()

with insMail

.From =" om *********** @ gmail.com"

.To =" om *********** @ gmail.com"

.Subject =" test"

.Body ="测试发送电子邮件"

结束

SmtpMail.SmtpServer =你的smtp服务器

SmtpMail。发送(insMail)

Console.WriteLine(成功发送电子邮件" +

vbCrLf)

Catch err As Exception

MsgBox(无法发送邮件,MsgBoxStyle.Critical,
错误)

结束尝试

结束子


但是,是否有限制;快速"版本或是否有/ b $ b编码错误?
Imports System.Web.mail
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click

Try
Dim insMail As New System.()
With insMail
.From = "om***********@gmail.com"
.To = "om***********@gmail.com"
.Subject = "test"
.Body = "test sending email"
End With
SmtpMail.SmtpServer = "your smtp server"
SmtpMail.Send(insMail)
Console.WriteLine("Successfully sent email message" +
vbCrLf)
Catch err As Exception
MsgBox("Couldn''t send mail", MsgBoxStyle.Critical,
"Error")
End Try
End Sub
However, is there a limitation for "express" version or is there
something wrong about coding?



你有什么问题?


你是否在连接到SMTP服务器时遇到问题?

What problem are you having?

Are you having trouble connecting to your SMTP server?


10月19日晚上11:30,Spam Catcher< spamhoney ... @ rogers.comwrote:
On Oct 19, 11:30 pm, Spam Catcher <spamhoney...@rogers.comwrote:

kimiraikkonen< kimiraikkone ... @ gmail.comwrote innews:11 ********************* @ k35g2000prh.googleg roups.com:
kimiraikkonen <kimiraikkone...@gmail.comwrote innews:11*********************@k35g2000prh.googleg roups.com:

Imports System.Web.mail

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e

As System.EventArgs)处理Button1.Click
Imports System.Web.mail
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click


尝试

Dim insMail As New System。()

With insMail

.From =" omar.abid2 ... @ gmail.com"

.To =" omar.abid2 ... @ gmail.com"

.Subject =" test"

.Body =测试发送电子邮件

结束

SmtpMail.SmtpServer =你的smtp服务器

SmtpMail.Send(insMail) )

Console.WriteLine(成功发送电子邮件消息; +

vbCrLf)

Catch err As Exception

MsgBox(无法发送邮件,MsgBoxStyle.Critical,
"错误")

结束尝试

结束子
Try
Dim insMail As New System.()
With insMail
.From = "omar.abid2...@gmail.com"
.To = "omar.abid2...@gmail.com"
.Subject = "test"
.Body = "test sending email"
End With
SmtpMail.SmtpServer = "your smtp server"
SmtpMail.Send(insMail)
Console.WriteLine("Successfully sent email message" +
vbCrLf)
Catch err As Exception
MsgBox("Couldn''t send mail", MsgBoxStyle.Critical,
"Error")
End Try
End Sub


但是,表达是否有限制。版本或是否有/ b $ b编码错误?
However, is there a limitation for "express" version or is there
something wrong about coding?



你有什么问题?


你是否在连接到SMTP服务器时遇到问题?


What problem are you having?

Are you having trouble connecting to your SMTP server?



不,我从Vb.net 2005获得了一些错误消息express从
开始
"'''Imports''语句必须在任何声明之前继续

其他关于declerations的错误(eginsmail,smtpmail)。


对不起是初学者。


谢谢......

No, i get some error messages from Vb.net 2005 "express" starting with
"''Imports'' statements must precede any declarations" continues with
other errors about declerations (e.g.insmail, smtpmail) as well.

Sorry for being beginner.

thanks...


kimiraikkonen< ki ************* @ gmail.comwrote in

新闻:11 ********************** @ z24g2000prh.googlegr oups.com:
kimiraikkonen <ki*************@gmail.comwrote in
news:11**********************@z24g2000prh.googlegr oups.com:

不,我从Vb.net 2005获得了一些错误消息express从
开始
"'''Imports''语句必须在任何声明之前继续

其他关于declerations的错误(eginsmail,smtpmail)。


对不起是初学者。


谢谢...
No, i get some error messages from Vb.net 2005 "express" starting with
"''Imports'' statements must precede any declarations" continues with
other errors about declerations (e.g.insmail, smtpmail) as well.

Sorry for being beginner.

thanks...



导入应该放在类文件的最顶层。


Imports System.Web .Mail

公共班....

你的功能


结束班

Imports should go at the very top of your class file.

Imports System.Web.Mail
Public Class....
Your Function Here

End Class


这篇关于System.Web.Mail命名空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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