uploading files in Email using c#.net

I have a c#.net ASP webpage. Please let me if anyone can provide with a code for Attaching files.
Thanking you.
10/6/2005 12:57:23 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 16

Hi here is some code.
MailMessage msgMail = new MailMessage();

msgMail.To = sender address;
msgMail.From = recepient address;
msgMail.Subject = mail subject;
msgMail.Body = body text;
msgMail.Attachments.Add(new MailAttachment(your file path));


Hope it will help.

10/6/2005 3:13:44 AM

try using the fileupload html control and change it to html webserver control.

dim fileArr() as string = FileUpload.PostedFile.FileName.split("\") ' to create an array with items of the file name path

dim FileName as string = fileArr.getuppbound(fileArr.Length) ' to get the file name

FileName = "C:\"+FileName
FileUpload1.PostedFile.Save(FileName)   ' to save the file to the server

Mark as an answer if it helps.
10/6/2005 4:26:22 AM
You can simply use this method to extract the file name: 

System.IO.Path.GetFileName("Whatever the path is");

Wanna get high!
10/8/2005 6:02:38 PM

Similar Artilces:

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

How to convert .tiff image file to .pdf file without using any 3rd party tool using C#.net
HI allI have a urgent requirement i want to convert .tiff image to .pdf file Thanks in advance Regards RaviPlease click "mark as answer" if this post helped you. I dont think its possible without doing a lot of code or using third party tools, but if you  are looking for a free tool you can try a combination of http://blog.codebeach.com/2008/02/convert-multipage-tiff-to-pdf-in-net.htmland  http://www.codeproject.com/KB/aspnet/Creating_PDF_documents_in.aspx Thanks and RegardsS.K.Vignesh----------------------Do remember to "Mark as answer" for this pos...

use of vb.net and c#.net
i make a small website using vb.net,  in it i make a 2 class in C#.net. that i want to use in that website, i dont know how to call that class. let your class is  - class clsMyClass    {        public void myFunction()        {            // do something        }    } now the first way - create objectclsMyClass myObj = new clsMyClass();myObj.myFunction(); // call function================...

Smart Device Application for file transfer to a remote server in .Net Compact Framework (Using Visual Studio.Net 2003,C# code)
Dear all, We are developing a smart device application (using C# code) for .Net Compact Framework where we need to write a programme in C# code to transfer a file from mobile device to remote server/machine.Can anyony help us regarding this aaplication.If you have already done this or you find any article/link regarding to this application then please let me know about that. My mail id : anirbandas.ju@gmail.com Looking forward for your reply soon. Regards Anirban   hi hav u got any solution , becoz i too need. plz share with me...

how to select multiple files at a time using Ctrl+select and upload the attachments in C# .Net 1.0?
Hi, Do any one know how to select multiple files at a time using Ctrl+select and upload the attachments in C# .Net 1.0? I know that by placing 4 or 5 attachment controls we can do that.But I want to select multiple at a time. Do any one know this???  i think there is no option to select multiple file at a time ... instead you  can use Upload Multiple files each at one time like Gmail..  Regards,M.VenkatesanMy Blog : http://venkat-dotnetsamples.blogspot.comPlease remember to click “Mark as Answer” on the post that helps you,and to click “Unmark as Answer” if a marked po...

how to select multiple files at a time using Ctrl+select and upload the attachments in C# .Net 1.0? #2
Hi,   Do any one know how to select multiple files at a time using Ctrl+select and upload the attachments in C# .Net 1.0? I know that by placing 4 or 5 attachment controls we can do that.But I want to select multiple at a time. Do any one know this??? Hello, I think, The file upload not have a property of selecting multiple files... As if you select a single file... the other will be automatically lost the control so that it can not be selected... Let me know you r exact requirement so that an alternate can be possible???ukrMark this as Answer if it helps you, As some other m...

Using Dot Net Nuke to maintain a site developed in VS.NET using C#
Hi,Does anyone know if there is a way to create a site using C# and Visual Studio.NET 2003, but then use Dot Net Nuke to allow non-technical users to add content to the site.  The current state of the site must be accessible in both VS.NET and DNN regardless of which application saved it last.  Also preferably I would like the language used to remain C# even when edited by the marketing staff, so that I can still maintain it myself using VS.NET.  Hope you understand what I mean. If this is not possible, I wonder if anyone knows what solution I am after.   Thanks in adv...

How to get datasource name dynamically from .txt / .xml file using C#.net 2.0 with Mysql 5.0
I am using C#.Net 2.0 With MySql 5.0. I created a project and it works fine in my machine. But problem occurs when i try to run the project other than my machine. I wrote datasource=mysystem name in connection string. Is it possible to get datasource name dynamically from a text file (*.txt) or from .xml file for MySql.Regards,Tamizhselvi  Add an App.Config file to your project and you can drop a connection string in there like so:  <connectionStrings>    <add name="PICK A NAME" connectionString="YOUR CONNECTION STRING"/>...

How to Create .mdb file from Excel file using C#.net
Hi all I want to create .mdb file that i have created excel feel from MS jet Database... through code behind Help me in this..  Regards RaviPlease click "mark as answer" if this post helped you. How to create an mdb file programmtically:http://support.microsoft.com/kb/317881How to import Excel data into it: http://www.mikesdotnetting.com/Article.aspx?ArticleID=79 Regards Mike [MVP - ASP/ASP.NET]My site...

Get email suffix (.net, .org, etc...) from email using Regular Expressions
Does anyone have a code snippet that could do this in VB.NET? I want it to return .net if given bob@microsoft.net Thanks, ScAndal.NET Web Based CRM http://www.kineticcrm.com.NET Consulting http://www.kineticmedia.net Hm. Well, I can get you started, but it won't handle sub-domain e-mails. To make this example easier for me to think about, this regex will look for: someword@someword.some.more.words (Why ".some.more.words"? Because of international country extensions) And it will save the ".some.more.words" part in the Groups property of the Match in in...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Re: Gadget using vb.net and c#.net
 Hi, I am new to Gadget Concept. i want to create new Gadget. it must show the name 'Gadget Application'. pls, guide me how to create Gadget using .net application with some sample. thanks for your help in advance. Regards,Suriyanarayana.N  Unfortunately creating a Gadget using the .NET framework is not so simple. I have found a few post that might help you understand the process:http://www.codeproject.com/KB/gadgets/gadgettips.aspx http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx Gabriel Bogéa (http://www.gbogea.com)-----------------Please 'Mark...

Web resources about - uploading files in Email using c#.net - asp.net.getting-started

Wikipedia:Uploading images - Wikipedia, the free encyclopedia
For more information on multimedia on Wikipedia in general (images, sound files, etc.), see Wikipedia:Media . Unfortunately large numbers of ...

Dropify Download 2.0 Simplifies Uploading Content To Facebook, Downloading, Sharing
... January, integrating with Facebook’s Open Graph and allowing users to make files available for download via the social network, and share uploading ...

New “Facebook for Every Phone” App Brings Photo Uploading and More to 2500 Different Feature Phones
Today, Facebook officially launched “Facebook for Every Phone”, a downloadable native mobile app compatible with 2500 different feature phones. ...

Defence bureaucrat pleads guilty to uploading secret document online
... embarrassing security breach with &quot;Five Eyes&quot; intelligence document. A former junior Defence bureaucrat has pleaded guilty to uploading ...

Uploading Bautista bat flip GIFs could get you sued under TPP, copyright activists warn
Copyright activists say Canadians could face lawsuits, fines or worse for ripping the latest Justin Bieber CD or uploading an animated GIF of ...

Facebook pages sharing less YouTube videos, uploading more video direct to site
While YouTube remains the gold standard for uploading videos online, a new study finds that its presence on Facebook is increasingly declining ...

Facebook for iOS updated with faster newsfeed, re-built timeline on iPhone, improved photo uploading
Facebook has updated its iOS application with improved speed for your timeline, newsfeed, and photo uploading. This update comes a couple of ...

Facebook Adds Features to Photo Uploading via iPhone, Android Apps
Facebook announced improvements to the ways that users upload photos to the social network via its iOS and Android flagship applications , allowing ...

Google Play Books updated, brings performance tweaks and uploading from your phone or tablet
PDF and ePub files can be shared to Google Play Books using the Android intents system

Twitter rolling out group messaging, 30-second video uploading
Fast Company Twitter rolling out group messaging, 30-second video uploading Android Community Different social networks are doing everything ...

Resources last updated: 12/31/2015 1:06:56 AM