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 !




Mail send using asp.net


Posted Date: 14 May 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: kulanthaiveluMember Level: Gold    
Rating: Points: 10



Mail send using asp.net
Following function used to send mail from asp.net application to mail ids. This function have eight parameters. Pass the values to that parameters then this function will take care to send mails.

Private Sub MailSend(ByVal MailSub As String, ByVal FromAddress As String, ByVal FromName As String, ByVal ToAddress As String, ByVal ToAddress1 As String, ByVal ToAddress2 As String, ByVal ToName As String, ByVal MailText As String)
       
Dim MM As MailMessage
Dim FromMailAddress As MailAddress
Dim ToMailAddress As MailAddress
Dim SM As New SmtpClient(Application("SmtpIp"))
Try
MM = New MailMessage()
FromMailAddress = New MailAddress(FromAddress, FromName)
ToMailAddress = New MailAddress(ToAddress, ToName)
With MM
.From = FromMailAddress
.Subject = MailSub
.Body = MailText
.To.Add(ToMailAddress)
.To.Add(ToAddress1)
.To.Add(ToAddress2)
End With
SM.Send(MM)
MailSendStatus = 0
Catch ex As Exception
MailSendStatus = 1
MailSendErrorMessage = ex.Message
Finally
MM.Dispose()
End Try
End Sub




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: Image Preview (Javascript and DataRepeater)
Previous Resource: Array as a datasource for Repeater control
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use