C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Sending emails from ASP.NET with attachment


Posted Date: 21 Jul 2007    Resource Type: Code Snippets    Category: Email

Posted By: Ranjith       Member Level: Silver
Rating:     Points: 10



This sample code shows how to send an email with an attachment.


Imports System.Web.Mail
Public Class WebForm2
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Search.Click
Dim MSg As New MailMessage
Dim mAtt As MailAttachment

mAtt = New MailAttachment("C:\mail.txt")
MSg.From = "pcranjithindia@gmail.com "
MSg.To = "pcrkidia@yahoo.co.in"
MSg.Subject = " From Ranjith "
MSg.Body = "Please see the attachment"

MSg.Attachments.Add(mAtt)

SmtpMail.Send(MSg)

Response.Write(" Done")
End Sub
End Class




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Send eMail in ASP.Net 1.1
Previous Resource: Sending E-Mails in C#
Return to Discussion Resource Index
Post New Resource
Category: Email


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

internet fax

Contact Us    Privacy Policy    Terms Of Use