SimpleMail is a library to facilitate the sending of messages through SMTP connections.
- Manual installation: Add the following folders to your project, in Project > Options > Resource Compiler > Directories and Conditionals > Include file search path
../SimpleMail/src
- Installation using the Boss:
boss install github.com/weslleycapelari/SimpleMail
By default, the library uses the most up-to-date components, in this case the current one is Indy.
You need to use SimpleMail
uses SimpleMail;
- Mail Server
var
LMailer: IMail;
begin
LMailer := TMail.New
.Hostname('smtp.gmail.com')
.Port(465)
.Username('[email protected]')
.Password('password')
.SSL(True)
.Timeout(10000)
.Connect;
if LMailer.IsConnected then
ShowMessage('Connected')
else
ShowMessage('Not Connected');
end;
- Message
var
LMailer : IMail;
LMessage: IMessage;
begin
LMailer := TMail.New
.Hostname('smtp.gmail.com')
.Port(465)
.Username('[email protected]')
.Password('password')
.SSL(True)
.Timeout(10000)
.Connect;
if LMailer.IsConnected then
begin
LMessage := LMailer.NewMessage
.From('[email protected]')
.Recipients('[email protected];[email protected]')
.CC('[email protected];[email protected]')
.CCo('[email protected];[email protected]')
.Subject('Test Email')
.Body('This is a test message')
.Send;
LMailer.SendMessage(LMessage);
end;
end;
A project was developed inside the example folder
SimpleMail
is free and open-source software licensed under the Apache-2.0 License.