A section of vb.net code, generate mail, send mail, support SMTP authentication username password.
Source: Internet
Author: User
Can generate mail, can send mail, a little modification can be written as a COM component, called in ASP.
Later I will be organized into a complete.
--------------------------------------------------------------------------------
'-------------------------------------------------
' Generate basic message format (including attachments), send mail to SMTP server,
' Can only be sent to the sender's SMTP server (requires authentication) and the direct delivery feature is being written.
'
' Disclaimer: In this code, there is a part of the line that borrows a hero's C # code. Unable to write the original author's name because it was not found
'
' Code writing: head Too faint
' qq:2538288
' Msn:qq2538288@hotmail.com
' Blog:http://spaces.msn.com/members/headfaint http://blog.111cn.net/super852
'-------------------------------------------------
Imports System
Imports System.Text
Imports System.IO
Imports System.Net
Imports System.Net.Sockets
Imports System.Collections
Namespace Ewebmail
Public Class Mail
' Message class to generate a basic message format. Visit Author Blog:http://spaces.msn.com/members/headfaint
Public Charset as String = "GB2312"
Public from as String
Public FromName as String
Public ReplyTo as String
Public Subject as String = ""
Public ishtml as Boolean = False
Public body as String = ""
Public TextBody as String = ' This is a HTML mail. '
Public Recipientmaxnum as Integer = 15 ' Maximum number of recipients access author Blog:http://spaces.msn.com/members/headfaint
Public recipient as New ArrayList
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.