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.MAI L)
I'm only allowed to declare under that namespaces with "system.web ":
System.Wb.AspNe tHostingPermiss ion
System.Web.AspN etHostingPermis sionAttribute
System.Web.AspN etHostingPermis sionLevel
Imports System.Web.mail
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
As System.EventArg s) Handles Button1.Click
Try
Dim insMail As New System.()
With insMail
.From = "omar.abid2006@ gmail.com"
.To = "omar.abid2006@ gmail.com"
.Subject = "test"
.Body = "test sending email"
End With
SmtpMail.SmtpSe rver = "your smtp server"
SmtpMail.Send(i nsMail)
Console.WriteLi ne("Successfull y sent email message" +
vbCrLf)
Catch err As Exception
MsgBox("Couldn' t send mail", MsgBoxStyle.Cri tical,
"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.MAI L)
I'm only allowed to declare under that namespaces with "system.web ":
System.Wb.AspNe tHostingPermiss ion
System.Web.AspN etHostingPermis sionAttribute
System.Web.AspN etHostingPermis sionLevel
Imports System.Web.mail
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e
As System.EventArg s) Handles Button1.Click
Try
Dim insMail As New System.()
With insMail
.From = "omar.abid2006@ gmail.com"
.To = "omar.abid2006@ gmail.com"
.Subject = "test"
.Body = "test sending email"
End With
SmtpMail.SmtpSe rver = "your smtp server"
SmtpMail.Send(i nsMail)
Console.WriteLi ne("Successfull y sent email message" +
vbCrLf)
Catch err As Exception
MsgBox("Couldn' t send mail", MsgBoxStyle.Cri tical,
"Error")
End Try
End Sub
However, is there a limitation for "express" version or is there
something wrong about coding?
Thanks...
Comment