In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about how to send E-mail in the VB.NET network. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
We often send E-mail emails, but do you know how we send our emails to the other party? This process can be achieved using the VB.NET network, so let's design the sending part of E-mail:
1. Parameter setting
Enter the Exchange system, select the new settings file, the required information service will be displayed on the screen, and select Internet Mail. Set the name of the settings file to test. The screen displays two options, and you can choose to connect by Modem or by Network. The author uses the Modem method; if you are making the Internet dedicated line, you should choose the Network method.
After choosing Modem mode, Exchange will ask us to enter the IP address of the mail server. Then set the mode of Transform Message to Automatic so that when we connect to the mail server, the new information is automatically downloaded to the local side. Next, set up the E mail address, full name, password and download path you are using.
2.VB.NET network programming
Add a MAPIMessage control to Form, name it MAPIMessage1;, join a MAPISession control, name it MAPISession1;, and add three TextBox controls, named Subject, Content and Addr. And add a Label in front of each of the three TextBox, and change the Caption to title, content and address respectively.
Set the properties of MAPIMessage1 as follows:
DownLoadMail=TRUE; LogonUI=TRUE; NewSession=FALSE; UserName= "send E mail".
Here, DownLoadMail is set to TRUE, and when the program connects to the mail server for * times, the new mail will be downloaded to the local end. If you set LogonUI to TRUE, when you enter the Logon name incorrectly in your program, a Message Box will be displayed for you to enter the correct name.
Because this program uses only one Session, you can set NewSession to FALSE. If you have a lot of Session to build, set it to TRUE. What is filled in UserName is the name of the settings file we added in Exchange. If there is no content, the system will display some Message Box asking you to enter the file. Add three buttons to Form, Logon, Logoff, and Send, and change their Caption to login, offline, and send, respectively.
Add the following code to the Logon_Click () event, and the function of the program is to log us in to the mail server:
MAPISession1.SignOn MAPIMessage1.SessionID=MAPISession1.SessionID sgBox "Your ID is" + Str (MAPISession1.SessionID)
Where MAPISession1.SignOn is the act of logging in. When you log in, because you have set the DownLoadMail property of the MAPIMessage1 control to TRUE, you can see Message Box on the screen, showing that the system is downloading mail. After the login is successful, the system will send back a SessionID and fill the ID into the SessionID of the MAPIMessage1, so that the Session can be used to transmit E-mail, and the user will be notified of the success with Message Box.
Add the following code to the Logoff_Click () event, and the function of the program is to get us off the mail server:
MAPIS1.SignOff
Add the following program code to the Send_Click () event, and the function of the program is to make us send E mail:
MAPIMessage1.Compose MAPIMessage1.RecipDisplayName = Addr.text MAPIMessage1.AddressResolveUI = TRUE MAPIMessage1.MsgSubject = Subject.text MAPIMessage1.MsgNoteText = Content.text MAPIMessage1.Send MsgBox "you sent it successfully!"
The main purpose of the Compose command is to enable you to change the content of RecipDisplayName, fill in the E mail address, topic and article content you need to send into RecipDisplayName, MsgSubject and MsgNoteText respectively, and then send it out with the Send command. VB.NET network programming is still very easy to use.
The above is how to achieve E-mail transmission in the VB.NET network shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.