By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

attach a file to email

P: 6
Hi

I tried to write program using below code

Expand|Select|Wrap|Line Numbers
  1. Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() 
  2.  
  3. oMsg.From = "noone@nobody.com" 
  4. oMsg.To = "someone@somewhere.com" 
  5. oMsg.Subject = "Email with Attachment Demo" 
  6. oMsg.Body = "This is the main body of the email" 
  7. Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") 
  8. oMsg.Attachments.Add(oAttch) 
  9. SmtpMail.Send(oMsg)
but problem is

Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()

above line doen't work.can anyone help me.

regards
Ranil
Mar 24 '14 #1
Share this Question
Share on Google+
1 Reply


P: 6
hi

I searched some code and I found but I cant understand below mentioned "name spase"

Imports EASendMail 'Add EASendMail namespace
Mar 24 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.