Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: ASP.NET .NET Sending e-mail with attachments from an ASP.NET page. Tutorial

This article describes how to send emails with attachments using System.Web.Mail namespace from an ASP.NET page. Full source code available for download.

Tutorial Details:

ASP.NET .NET Sending e-mail with attachments from an ASP.NET page. Tutorial
The task of sending e-mails has become much easier in ASP.NET. In previous versions of ASP we either used a third party component or the limited functionality of CDONTS component for sending emails. The .NET framework provides simpler but powerful class libraries for sending emails. These classes are in the System.Web.Mail Namespace.

i.AspEmail : Most feature-rich mailing component. Supports message queueing, embedded images, secure mail, authentication.In order to access these classes we have to import the System.Web.Mail namespace within our ASP.NET page using the import directive as shown below :
<% @ Import NameSpace = "System.Web.Mail" %>

Then we construct an email message by creating an Instance of the MailMessage class as shown below :
MailMessage MyMail = new MailMessage();


Email address of the recipient. To send an attachment with email we need to create an instance of the MailAttachment class. We pass the full path of the file to be attached as an argument to the constructor of MailAttachment class as shown below :

MailAttachment MyAttachment = new MailAttachment("C:\\My Folder\\MyFile.txt");
Note : The file name passed should be valid file which exists on the server.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
ASP.NET .NET Sending e-mail with attachments from an ASP.NET page. Tutorial

View Tutorial:
ASP.NET .NET Sending e-mail with attachments from an ASP.NET page. Tutorial

Related Tutorials:

Program Java devices -- An overview - JavaWorld July 1999
Program Java devices -- An overview - JavaWorld July 1999
 
Introduction to the Java Mail API
Introduction to the Java Mail API
 
Rumble in the jungle: J2EE versus .Net, Part 1
Rumble in the jungle: J2EE versus .Net, Part 1
 
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP).
 
The J2EE 1.4 Tutorial
The J2EE 1.4 Tutorial is a guide to developing enterprise applications for the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Here we cover all the things you need to know to make the best use of this tutorial.
 
SAAJ: No strings attached
SAAJ: No strings attached
 
Aspirin - embeddable java smtp server
Aspirin - embeddable java smtp server What is it? Aspirin is an embeddable send-only SMTP server. Why would I want that? The JavaMail API doesn't really let you send mail. And that's just annoying. Developers shouldn't have to jump through hoops t
 
Java SMPP API Homepage
Java SMPP API SMPP (Short Message Peer to Peer) is a protocol used by short message entities (SMEs) to communicate with Short Message Service Centres (SMSC, or just SC) for sending an receiving short messages.
 
Create Intelligent E-mail Filters with JavaMail and Classifier4j
Create Intelligent E-mail Filters with JavaMail and Classifier4j Tired of the limitations and annoying false positives with commercial spam filters? Classifier4J is an open source Java library that will let you build custom applications that read e-mails
 
Jeff Schmitt's JDBC Page
This tutorial assumes you are using the MySQL database and the GWE JDBC drivers. The host computer is triton.towson.edu.
 
Servlets and JavaServer Pages (JSP) : A Tutorial
An excellent tutorial on JSP and Servlets.
 
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack
 
Calling JavaBeans from a JSP Page
We will be using this SimpleBean class in this tutorial, so if you haven't read above article then I suggest you do it now.
 
Welcome to Java Developers paradise!
Welcome to Java Developers paradise! T his site contains many quality Java, JSP, RMI, MySQL downloads, tutorials, source codes and links to other java resources. We have large number of links to the tutorials on java which will help you learn java
 
Your homepage for Cheapest domain name registration, Domain Forwarding Services, Web Designing | Roseindia Domain Regist
Your homepage for Cheapest domain name registration, Domain Forwarding Services, Web Designing | Roseindia Domain Registration DOMAIN REGISTRATION SERVICES Roseindia.net is the leading provider of cheapest Domain registration services in India.
 
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java Open Source Web Frameworks in Java Struts Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open
 

Free Web Site Hosting Services Below is the listing of the hosting providers providing free web hosting services. These services helps you building your sites even if you have no experience in HTML writing. Zero
 
Accessing Database from servlets through JDBC!
Accessing Database from servlets through JDBC! Accessing Access Database From Servlet T his article shows you how to access database from servlets. Here I am assuming that you are using win95/98/2000 and running Java Web Server. For the sake of
 
Buy SuSe 9.2 Professional CDs in India from us. SuSe 9.2 Professional is available with us.
Buy SuSe 9.2 Professional CDs in India from us. SuSe 9.2 Professional is available with us. SuSe 9.2 Professional Linux Now Available SuSe 9.2 Professional CD's SuSE Linux 9.2 is secure and stable. Its installation routine is now almost fully
 
Client Side Address Validation in Struts
Client Side Address Validation in Struts Client Side Address Validation in Struts In this lesson we will create JSP page for entering the address and use the functionality provided by Validator Framework to validate the user data on the browser.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.