Try
'// Setup the new message.
Dim Message As New MailMessage("To", "From", "Subject", "Message")
'// Set the server to receive the smtp, exchange server or remote smtp
server
Dim EmailClient As New SmtpClient("DNS or IP")
'// If authentication is require it's set here.
' Dim SMTPUserInfo As New System.Net.NetworkCredential("Username",
"Password")
'// Defined by the above process, but doesn't seem to make much difference
is authentication is not required.
EmailClient.UseDefaultCredentials = False
'// If UserInfo is required this also need to be un-remmed
' EmailClient.Credentials = SMTPUserInfo
'// Send the Email!
EmailClient.Send(Message)
'// And confirm!
MsgBox("Done!")
"Rico" <me@you.comwrote in message news:s5MJh.41851$lY6.37874@edtnps90...
Hello,
I have an application in VB 2003 that uses System.Web that creates and
sends an email. I'm trying to turn this application into a Windows
Service in VB 2005 and have discovered that System.Web.Mail is replaced by
System.Net.Mail, but it seems the "To" property is read only now? How do
I set this property so I can actually send the email?
Any direction would be greatly appreciated.
Thanks!
Rick