Here is a class doing the job connecting directly to the mailserver,
not by me. Found it somewhere on the web
So this uses no defoult client
* add the System.Web.Dll reference to your .Net
'* project if doing a Windows Application. An
'* ASP.Net app should include this reference.
'* Simply declare an object of type SendMail in code, ie another class
like a form class,
'* set the body and subject properties, then call
'* MailMessage to send the email
Imports System.Web.Mail
Public Class SendMail
Private _Subject As String
Private _Body As String
Private _Attachment As String
Private _Adress As String
Public Property Adress() As String
Get
Return _Adress
End Get
Set(ByVal Value As String)
_Adress = Value
End Set
End Property
Public Property Subject() As String
Get
Return _Subject
End Get
Set(ByVal Value As String)
_Subject = Value
End Set
End Property
Public Property Body() As String
Get
Return _Body
End Get
Set(ByVal Value As String)
_Body = Value
End Set
End Property
Public Property Attachment() As String
Get
Return _Attachment
End Get
Set(ByVal Value As String)
_Attachment = Value
End Set
End Property
Public Sub MailMessage()
Dim objMail As New MailMessage
'Dim attach As New MailAttachment(_Attachment)
SmtpMail.SmtpServer = "000.00.00" 'this needs to be the Smtp
mail server, a proxy will not work, get this from your administrator,
or Exchange server name in outlook
objMail.From = "sender@home"
objMail.To = _Adress
objMail.Subject = _Subject 'Subject text
objMail.Body = _Body 'Body Text
objMail.BodyFormat = MailFormat.Text 'Html 'can be text also
SmtpMail.Send(objMail)
End Sub
End Class