K
kimiraikkonen
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 = "(e-mail address removed)"
.To = "(e-mail address removed)"
.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...
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 = "(e-mail address removed)"
.To = "(e-mail address removed)"
.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...