CodeWidgets.com: Online Source Code Library: C#, ASP, ASP.NET, VB, VB.NET, VB Script, Microsoft Access, Excel, JavaScript, J Script, XML, VBScript, Website Design, DevExpress Components, Reporting, Application and Website Templates.

Widget #CS0051

Send Email Using SMTP Mail (ASP.NET, VB.Net)

Free

VB.Net Class
CMailMessage.vb
Send Email from your ASP.Net web pages
Copy and paste the code below into a VB.Net Class Module

'STARTCODE
Imports System.Web.Mail
Public Class CMailMessage
'SMTP Mail Class
'Widget# CS0051 CodeWidgets.com
'SYNTAX to use the Class
'/////////////////
'Dim MailMessage As New CMailMessage()
'MailMessage.Send("RecipientEmail", "SendersEmail", "The Subject", "This is the Message Body", Mail.MailFormat.Html)
' MailMessage = Nothing
'/////////////////
Public Sub Send(ByVal m_Recipient As String, ByVal m_Sender As String, ByVal m_Subject As String, ByVal m_Message As String, ByVal m_Format As Mail.MailFormat)
Dim Msg As New MailMessage()
With Msg
.To = m_Recipient
.From = m_Sender
.Subject = m_Subject
.BodyFormat = m_Format
.Body = m_Message
' Substitute HOST with the Local SMTP Domain name found in the IIS Managment Console
Dim strMailHost As String = "HOST"
SmtpMail.SmtpServer = strMailHost
SmtpMail.Send(Msg)
End With
End Sub
End Class
'ENDCODE

Last Updated: 4/27/2018


Related Widgets 
Price 
# 
CS0214 Microsoft® .NET Framework 4.5.2$0.00Add To Cart
CS0197 Storing a DataSet in a Session Variable (ASP.NET)$0.00Add To Cart

Recently Viewed Widgets 
Price 
# 
No data to display

Collapse/Expand
Format

Plug & Play Code

Copy the Source Code Above..


Collapse/Expand
License

License

No Restrictions

Re-Distribution Permitted
This source code is provided to you "as is" without warranty
CLICK HERE FOR TERMS OF USE
Copyright 2000-2006 Comrie Software Solutions


This website uses Cookies to store User information and Shopping Cart Items for the duration of your visit to CodeWidgets.com.

No Credit Card or Financial information is stored by CodeWidgets.com. Click Here For Our Complete Privacy Policy and Terms of Use.

I Understand