record.
// Use the NSLookup program to query MX records and obtain the mail server corresponding to the domain namePublic String getmailserver (string stremail){String strdomain = stremail. Split ('@') [1];Processstartinfo info = new processstartinfo ();Info. useshellexecute = false;Info. redirectstandardinput = true;Info. redirectstandardoutput = true;Info. filename = "NSlookup ";Info. createnowindow = true;Info. Arguments = "-type = Mx" + strdomain;Process NS = process. Start (Info );Streamr
OKRcpt to: me@brookes.com> 250 OK its for me@brookes.comDATA> OK. send it; end with Soem data.> 250 message queuedQUIT> 221 Goodbye.The gray part of the code is a conventional Email address check method that checks the validity of the address form.The program uses the System. IO, System. Net. Sockets, System. Diagnostics namespace, and calls it through checkMail
Copy codeThe Code is as follows:/// /// Check whether the entered email address strEmail is valid. If it is invalid, true is returned./// Public bool CheckEmail (string strEmail){Int I, j;String strTmp, strResult;String strWords = "abcdefghijklmnopqrstuvwxyz _-. 0123456789"; // define valid character rangesBool blResult = false;StrTmp = strEmail. Trim ();// Check
Comparison | function | The following function can check the email address format, only in the form of:
ABC@ABC.ABC,ABC@ABC.ABC.ABC and ABC@ABC.ABC.ABC.ABC-like strings to pass the check,
The following illegal addresses will not pass:
@abc @163.net,abc@163..net,abc@163.
inadequate, and the correct email address format does not prove to be valid. For this reason, some websites adopt methods such as sending passwords by email and URLs of special resources, or require users to reply to emails to ensure the validity of the email address. However, these methods are not always effective. For example, you may not collect user emails f
I. Introduction
In the previous article, we analyzed in detail ,. net Framework 2.0 provides a new namespace (system. net. mail) and some new email sending classes (Note :. net Framework 1. the namespace system provided in Version X. web. mail and related classes can still be used for backward compatibility ). In add
I. Introduction
In the previous article, we analyzed in detail ,. net Framework 2.0 provides a new namespace (system. net. mail) and some new email sending classes (Note :. net Framework 1. the namespace system provided in Version X. web. mail and related classes can still be used for backward compatibility ). In add
Use C #. NET to implement the email client program,
Use C #. NET to implement the email client program
Zhou Huaqing Dai yaohui (Department of computer and communication, Donghua Institute of Technology, Fuzhou 344000, China)
【Abstract】 using C #, a new object-oriented and type-safe programming language introduced in Vi
inadequate, and the correct email address format does not prove to be valid. For this reason, some websites adopt methods such as sending passwords by email and URLs of special resources, or require users to reply to emails to ensure the validity of the email address. However, these methods are not always effective. For example, you may not collect user emails f
of the email. " ; // Email body Smtpclient mailclient = New Smtpclient ();Mailclient. Send (Message );}
compared with the code method, we found that the configuration method code saves the credentials , the Code becomes quite concise, and more importantly, the information can be stored on the web. configuration in the config file, which greatly increases the flexibility of the program, which
, which can be used in various forms of applications, including Web services, Windows applications, controls, and so on, with a maximum of one change in the declaration mode. To facilitate testing of these functions, let's do a simple user interface in the form of Windows applications.
Start Vs.net, select New Visual Basic project, Windows application, figure two, enter project name Checkmail and save location, click "OK" button, VS. NET to c
Original article: http://blog.joycode.com/dotey/archive/2005/01/15/43113.aspx
ASP. NET forums email sending
In forums, email sending is required in many places, such as email registration, password retrieval, and email subscription.
Add a new postCodeThe process is very
addresses, which can be used in various forms of applications, including Web services, Windows applications, controls, and so on, with a maximum of one change in the declaration mode. To facilitate testing of these functions, let's do a simple user interface in the form of Windows applications.
Start Vs.net, select New Visual Basic project, Windows application, enter project name Checkmail and save location, click "OK" button, VS. NET
ASP. NET sends email with COM ComponentZhang Feng (A Hao. Net)
Send the email in the development emailProgramWe often need to use the corresponding components. In fact, third-party components (such as jmail) are not required to send emails as usual.
In the System32 subdirectory of the system directory (such as c: \
In this paper, we describe the method of Python script to realize the check-in function of shrimp net. Share to everyone for your reference, as follows:
Overview
This script completes the automatic log in the shrimp net, the sign-in function.
Roughly use Urllib, URLLIB2, cookielib these modules. The fact is to use Python to implement the post data to the specifi
When you do not use the SMTP port 25 to send an email, some low-Permission execution environments may throw an exception. You 'd better check the permissions before performing the operation.
SMTP has the following permissions in. Net: smtppermission type (and declarative smtppermissionattribute attributes, all of which are in the system.
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.