Tuto WINDEV 25

Part 4: Full application with data 245 ▶ Align the different controls found in the window. We will now create the Button control to send emails. Sending the email ▶ To create the Button control to send emails: 1. On the "Creation" pane, in the "Usual controls" group, click . 2. Click the location where the control will be created (at the bottom of the window for example). 3. Select the control and modify its caption (press Enter for example). The new caption is "Send". 4. Edit the WLanguage code associated with this Button control: select "Code" in the popup menu (right click). 5. Write the following lines of code in the "Click" event: • WLanguage code for opening the connection and starting the SMTP session: MySession is EmailSMTPSession MySession..Name = EDT_User MySession..Password = EDT_Password MySession..ServerAddress = EDT_SMTP_Server MySession..Port = EDT_Port // Starts the SMTP session IF NOT EmailStartSession(MySession) THEN Error("Unable to connect to the SMTP server.", ... ErrorInfo()) RETURN END

RkJQdWJsaXNoZXIy NDQ0OA==