Hi Landley,
Almost, but you have to have an smtp server reference, or else the system
does not know what it is. You could find some esoteric way to query the
current accounts inside Outlook or Outlook Express, but even the query
wouldn't know if that were a valid smtp server.
Here's the easiest way to do it:
Begin your class with a reference to system.web.mail:
Imports System.Web.Mail
Then add the code as appropriate:
Dim msg As New MailMessage
msg.To = "be*****@xxxx.net"
msg.From = "MN***@xxxxx.com"
msg.Subject = "test subject"
Dim astring1 As String = "c:\my documents\wzo letter.doc"
msg.Attachments.Add(New MailAttachment(astring1))
Dim astring2 As String = "c:\my documents\visual basic notes.doc"
msg.Attachments.Add(New MailAttachment(astring2))
Dim astring3 As String = "\\imcsql\data\imcapps\sqldiag.txt"
msg.Attachments.Add(New MailAttachment(astring3))
msg.Cc = "we*******@xxxxx.com"
SmtpMail.SmtpServer = "mail.xxxxx.com"
Try
SmtpMail.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
HTH,
Bernie Yaeger
"Landley" <ne**@creations-software.co.uk> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...
Hello,
Is there a way of creating an email, attaching a file and sending using
the
client's default mail client?
I am looking for a none email client specific solution that does not
involve
specifying parameters such as mail servers etc.
Cheers,
Landers