Hi Larry,
This worked fine for me:
Dim msg As New MailMessage()
msg.To = "be*****@optonline.net"
msg.From = "be*****@cherwellinc.com"
msg.Subject = "test subject"
msg.Body = "this is the test info"
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))
msg.Cc = "we*******@cherwellinc.com"
SmtpMail.SmtpServer = "smtp.registeredsite.com"
Try
SmtpMail.Send(msg)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
HTH,
Bernie Yaeger
"larry mckay" <la***@larrymckay.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
I'm trying to send mail using the
mail.smptserver,
mailmessage,
mailattachment objects
I'm having trouble assigning an attachment to before doing an smpt.send
using vb.net
does anyone have any coding samples on how to programatically add mail
attachments using .net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!