Hi Larry,
This worked fine for me:
Dim msg As New MailMessage()
msg.To = "be*****@optonl ine.net"
msg.From = "be*****@cherwe llinc.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\visua l basic notes.doc"
msg.Attachments .Add(New MailAttachment( astring2))
msg.Cc = "we*******@cher wellinc.com"
SmtpMail.SmtpSe rver = "smtp.registere dsite.com"
Try
SmtpMail.Send(m sg)
Catch ex As Exception
MessageBox.Show (ex.Message)
End Try
HTH,
Bernie Yaeger
"larry mckay" <la***@larrymck ay.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.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!