Hi..Every One I have a doubt in Vb.NET windows application in attaching multiples files for mail application

 Iam having a Button named ReportSend If iam clicking that button I do the following code to work beyond it..The doubt is Iam having a vb application already done and i need to take .xml file and log.txt files alone in attachment by using application.path..how to do this..iam giving My code please help..i need to complete this module by few days.

 

D:\RAST\RAST\bin\Debug\Reports -- this path contains many .xml files

 D:\RAST\RAST\bin\Debug -- this path contains many .log files

Without giving the full path i need to take only those .xml and .log extension files using application.path ..Please help me what are all the extensions neede to be made in my code..iam giving my code below..

 

Imports System.Net.Mail
Imports System.Net.Mime
Imports System.Net
Public Class frmMailSend
    'Dim path As String
    Dim mail As New MailMessage()
    Private Sub btnSendReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendReport.Click
        Dim SmtpServer As New SmtpClient()
        Dim Attach As Net.Mail.Attachment = New Net.Mail.Attachment("D:\MATS\MATS\bin\Debug\Reports\Report1.xml")
        Dim Attach1 As Net.Mail.Attachment = New Net.Mail.Attachment("C:\Program Files\CMC Limited\MATS\AccessExport03052009.log")
        'SmtpServer.Credentials = New Net.NetworkCredential("balajirash_2006", "")
        SmtpServer.Port = 587
        SmtpServer.Host = smtp.gmail.com
        'SmtpServer.EnableSsl = True
        mail = New MailMessage()
        Try
            mail.From = New MailAddress("balaji2474@gmail.com", "Developers", System.Text.Encoding.UTF8)
            mail.To.Add("balaji2474@gmail.com")
            mail.Subject = "Report Docements For MATS Application!"
            mail.Body = "Attached Report Documents"
            mail.Attachments.Add(Attach)
            mail.Attachments.Add(Attach1)
            mail.IsBodyHtml = True
            mail.Priority = MailPriority.High
            mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
            mail.ReplyTo = New MailAddress("balaji2474@gmail.com")
            SmtpServer.Send(mail)
            MessageBox.Show("Mail Sent Successfully")
        Catch ex As Exception
            MsgBox(ex.ToString())
        End Try
        If btnSendReport.Enabled = True Then
            btnSendReport.Enabled = False
        End If
    End Sub
     
End Class
 


Taurus
0
balajie100
3/18/2009 8:28:30 AM
asp.net.free-for-all 9281 articles. 0 followers. Follow

0 Replies
191 Views

Similar Articles

[PageSpeed] 13

Reply:

Similar Artilces:

VB.Net
Hi guys, hoping that you may be able to help me on this one. Is there anyway I can run a Console Application, from a button click (or similar) within my windows application. I am using VB.Net in Visual Studio 2005. Any help would be great. ThanksPhil This is an ASP.NET forum. For better responses refer to the winforms forum at MSDN http://forums.microsoft.com/msdn/default.aspx?siteid=1What you can do is launch a process that targets the executable file for the console application.  Hey, thanks for getting back to me - I am going to try calling in a batch file to run the con...

Vb.Net Console Application vs. Windows Application
What is the difference between creating a Console Application in Vb.Net and a Windows Application in VB.Net? one runs on the command line and the other in a windows interface. so what's the real question?RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadableJason Brown - MVP, IIS...

How to extract xml file from window application to web application in .net
hi..i have two software solutions both in .net one is desktop and another is web application.And i want to transfer data between these application using xml. In desktop solution i have created a xml schema and create a xml document that conforms to that schema.XML doucment is created which contains the data.Now i have to extract this xml document into my web application and store the data of this xml file into my database and vice versa. So tell me what are the different methods to get the document from desktop to web and from web to desktop.Actaully i am not much aware of this type i...

Can a .NET web based intranet application call a windows based .NET application?
   Is it possibly to have an asp.net 2.0 application call/invoke a windows desktop application written in .NET 2.0? We have a .NET 1.0 windows desktop application that was written in C#. We also have a new .NET intranet web application written in asp.net 2.0. Is it possibly to have a button on the web application that when pressed will invoke the .NET 1.0 windows application? And then if someone closes the application, it will return control back to the ASP.NET 2.0 application?    Are you referring to running a WinForms application on the server or on the client PC? ...

Send e-mail by VB .NET Windows application
Hi! I am going to creat and send a mail message with a Win form Visual Basic .NET application. But the System.Web.Mail namespace may not be imported to the code (It just works in ASP .NET Web applications!?). What should I do? Which namespace is proper? Much obliged to you for your attention. Regards! Yours thankfully, M.Sadegh Samiei See if below link helps you! http://www.thecodeproject.com/csharp/IndySMTP.asp Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti It looks to be just for C#! There is nothing called "Indy" at Visual Basic .NET. The...

file upload control for windows desktop application using vb.net
hi can anybody pls tell me the control for uploading a file in windows application using vb.net.I know that we have file upload control in asp.net for webforms as well as in html controls. But this time i've to create a desktop application and have a window form that allow user to upload the images,as well as text files etc through this window form. This is really urgent.Pls help. Thanks,Neha    In window forums you need to use SaveFileDialog to do the file saving... This forum is dedicatedly for Asp.Net related web development, so if you have any queries ...

vb.net and c# files in one web application projects and website project
hi,I got a bunch of files which is the source code of the application I am working on, it did not have any solution or project files. They appear to be asp.net 2.0 files, as partial classes are used.I initially added these files to a website project and I was able to run app in VS2005. My problem starts when I try and deploy application. msbuild is used to compile dependent projects, but it does not generate a dll for my web project which contains an APP_CODE folder. So my web app files cannot find the dll it needs. Precompiling is not an option my our process. Does anyone has any suggestion...

How to deploy .Net Windows/Web applications
Hello can anyone please advise me guide me how to deploy .Net Windows/Web applications. I know how to do basic deployment but i want to know more about database connection string, Support files specific to application.   Please help--------ThanksSK Hi there,Database connections will not change too much, you will only need to change the Uid,password, server and sometimes database name.you can also create a setup file which will setup all the things. check out these:http://support.microsoft.com/kb/818016 http://15seconds.com/issue/041229.htm http://www.microsoft.com/tec...

Problems while porting .Net framework 1.0 (VB.Net) application to .Net Framework 1.1
Hello,   I have a ASP.Net web application,written in VB.Net,developed on .Net Framework 1.0 .I am trying to port it on to .Net framework 1.1.   For achieving this,I follow the following steps-   1.Open the project using the .vbproj file. 2.I am prompted with the conversion message "Do you want to convert the solution and all projects to .Net framework  1.1....." 3.I click "Yes" 4.I assume that the project is now converted. 5.I build the project & try to run it. 6.I get the following error -     Server Error in '/Consert.Net' Application. ...

Convert VB.Net application to C#.net
Haican any one help me to convert VB.Net application in this link to C#.net http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6718&lngWId=10RegardsAnu Palavila  Regards Anu Palavila Use this Free Conversion tool - http://www.developerfusion.com/tools/convert/vb-to-csharp/  ASP.NET Grid With Excel Capabilities | 27 GridView Tips & Tricks | Hosting your site? | SQL Server Tips Other Code Convertors (convert VB to C# and C# to VB) http://converter.telerik.com/ http://www.developerfusion.com/tools/convert/csharp-to-vb/ http://www.dotnetspider.com...

migrating a powerbuilder application to a VB.Net application
I want to migrate an application built with powerbuilder to a VB.Net application. Someone is supposed to work on that application but the person can only work in the VB.Net environment.So i want to find out if there is a way of migrating my powerbuilder application to VB.Net Wrong newsgroup :-) <bernard>; <ghana> wrote in message news:46c6f6a8.1595.1681692777@sybase.com... >I want to migrate an application built with powerbuilder to > a VB.Net application. Someone is supposed to work on that > application but the person can only work in the VB.Net > envir...

Integrating the C#.net and VB.net application
Hello All,  I'm trying to integrate the C#.net application and VB.net application.  Can you give me any suggestions of how to merge them.  Thanks in Advance You are probably goign to have to convert one of the applications to the other language at one point.  There are online conversion tools to help http://www.carlosag.net/Tools/CodeTranslator/- WilliamPlease mark the most helpful reply/replies as "Answer".Give some of my PWSK modules a try.  Type of application?We All move to our original place.Don't forget.Imran Baloch @weighfield: I d...

vb.net windows application
i have a project in windows application .I have a inheritted form and when i try to run the application it gave one messae.Saying "THE LINE ENDINGS IN THE FOLLOWING FILE ARE NOT CONSISTENT.DO YOU WANT TO NORMALIZE THE LINE ENDINGS?". I couldn't understand it . Wht is that message?   Since your question is related to a Windows applicaiton and not ASP.NET, I recommend you post on the MSDN Forums.RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

Using .net AJAX enabled application in non .net Web Application
Hi,Does anyone have similar experience in development?  I want to check if it's possible to run .net ajax object (from one standalone .net framework platform in company) with non .net application (i.e. J2EE web application)?  It is because we want to add certain feature (i.e. office communicator chat) to our exist application (oracle J2ee). Please give me some advice :) Thanks! Hi, .Net AJAX is based on .Net Framework architecture. Thus .Net Framework currently lacks support for other platforms, such as Java. Please check this link: http://www.csharphelp.com/arch...

Web resources about - Hi..Every One I have a doubt in Vb.NET windows application in attaching multiples files for mail application - asp.net.free-for-all

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

ACT development application volume falls between 2015 and 2014
Development applications dropped in the ACT in 2015 compared with 2014, year-end government figures show.

Welfare experiment may have applications in Australia
A trial in Finland providing an obligation-free basic income could change how we think about welfare.

AVO application against Labor's Jamie Clements withdrawn
An application for an apprehended violence order against Labor powerbroker Jamie Clements - based on allegations he tried to kiss a female staffer ...

Patent application shows Apple Watch band that transforms into a case, stand and Mac accessory
An Apple patent application published today reveals an idea for an interesting variation on the magnetically-closed Milanese Loop band that allows ...

Seagate Introduces First 8 TB Hard Disk Drive for Consumer NAS Applications
Seagate Technology on Tuesday introduced its new breed of hard disk drives (HDDs) for network area storage (NAS) and RAID applications. The new ...

MBA: Mortgage Applications Increased in Latest Weekly Survey, Purchase Applications up 19% YoY
From the MBA: Mortgage Applications Increase in Latest MBA Weekly Survey Mortgage applications increased 21.3 percent from one week earlier, ...

Mortgage applications sink after rush
A Fed rate hike pulled mortgage demand forward, and made for a steep drop-off in the past two weeks.

SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika
SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika

In Application To Move To Los Angeles, Rams Shit All Over City Of St. Louis
... to relocate to the greater Los Angeles metropolitan area. The relocation would be effective for the 2016 NFL League Year.” The Rams’ full application ...

Resources last updated: 1/18/2016 7:08:41 PM