473,466 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

attach a file to email

6 New Member
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
1 1554
PriyadarshRa01
6 New Member
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

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

Similar topics

1
by: ohb | last post by:
Hello, is someone have a example of c# source of a service which is reading a attach file of an email.? Thank you. OHB.
2
by: ohb | last post by:
Hello, Is it possible to parse a attach file in a email ? ohb
1
by: SibAndela | last post by:
Is there a way that I can attach the uploaded file from a client web site to the web server without first storing the uploaded file on the server? Currently on my local PC (local host) the...
2
by: Landley | last post by:
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...
5
by: Jess | last post by:
I'm trying to build a page that the user can attach a file/s to and email them thru a form. I see plenty of info on how to actually code it to send with a variable - but how do you build a form...
2
by: calebmichaud | last post by:
Hi I am having trouble understanding how to attach a file or files to a record. I want to (in form view0 allow the user to attach one or more than one file to the associated record, and then...
1
nirmalsingh
by: nirmalsingh | last post by:
hi everybody, my code for sending email is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title>...
3
by: =?Utf-8?B?YmVueQ==?= | last post by:
See the ASP code below in order to send an email. How can I attach a file to this email please? set objMailer = Server.CreateObject("CDONTS.Newmail") objMailer.From = "anySender@123.com"...
7
by: RRsonawane11 | last post by:
Hello, Can anyone know how to write asp code to attach one file and email it to a specified email address. The attach file is the client choose from their Local Harddisk, just like we ...
2
by: Ken | last post by:
I have a large text file that is send with mail. I would like to save the text as a file (*.txt) and then attach it to the email. Can I do that with PHP? How do I save the text $body as a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.