Discuss this help topic in SecureBlackbox Forum
Send the message
SMTP client functionality is provided via TElSMTPClient component.
First you need to specify the addres and port of the remote SMTP server. This is done using Address and Port properties of TElSMTPClient class.
If the server uses authentication, you need to specify the username and password. Use UserName and Password properties of TElSMTPClient class for this.
If you need to use SSL/TLS, see the corresponding how-to article.
When you set the properties, you can call Open() method of TElSMTPClient class to establish the connection. Once the connection is established, call Login() method of TElSMTPClient class to login to the server. The login procedure includes sending a greeting message, authenticating (if needed) and switching to TLS mode (if needed). During login, the client must send his DNS name to the server. Some servers ignore the sent value, while others perform backresolving and decline the login if the names given and resolved don't match.
After the succesful login the application can send messages. This is done using one of Send() methods of TElSMTPClient class. The method is overloaded, i.e. accepts different sets of parameters. You can send an instance of TElMessage or TElSimpleMIMEMessage class. Alternatively you can send the body of the message constructed in code or using some other MIME classes.
After the messages are sent use Close() method of TElSMTPClient class to gracefully close the connection.