TEmailSender is a simple Delphi class for sending emails from Delphi applications. With easy-to-set configurations for SMTP server, sender, recipient, subject, and message body, and support for file attachments, sending emails has never been easier. This repository includes a complete implementation of the TEmailSender class and usage examples to help you get started quickly.
O TEmailSender é uma classe simples para enviar e-mails a partir de aplicações Delphi. Com configurações fáceis para servidor SMTP, remetente, destinatário, assunto e corpo da mensagem, e suporte a anexos de arquivos, o envio de e-mails nunca foi tão fácil. Este repositório inclui uma implementação completa da classe TEmailSender e exemplos de uso para ajudá-lo a começar rapidamente.
- Easy-to-use interface
- Support for SMTP server configuration
- Support for sender, recipient, subject, and message body
- Support for file attachments
- Interface fácil de usar
- Suporte à configuração do servidor SMTP
- Suporte a remetente, destinatário, assunto e corpo da mensagem
- Suporte a anexos de arquivos
- Delphi 7 or later
- Indy 10 or later
- Delphi 7 ou posterior
- Indy 10 ou posterior
- Download the
EmailSender.pas
file. - Add the file to your Delphi project.
- In the uses section of your project, add
EmailSender
to the list of units. - Start using the
EmailSender
class in your code.
- Baixe o arquivo
EmailSender.pas
. - Adicione o arquivo ao seu projeto Delphi.
- Na seção "uses" do seu projeto, adicione
EmailSender
à lista de unidades. - Comece a usar a classe
EmailSender
no seu código.
Here's an example of how to use the TEmailSender class:
var
email:TEmailSender;
begin
email := TEmailSender.Create;
try
email.SMTPHost := 'smtp.yourserver.com';
email.SMTPPort := 587;
email.SMTPUsername := '[email protected]';
email.SMTPPassword := 'yourpassword';
email.FromAddress := '[email protected]';
email.ToAddress := '[email protected]';
email.Subject := 'Test email with attachment';
email.Body := 'This is a test email with attachment';
email.AttachmentFilePath := 'c:\attachedfile.pdf';
try
email.SendEmail;
except
on E: Exception do
ShowMessage('Error sending email: ' + E.Message);
end;
finally
email.Free;
end;
end;
Aqui está um exemplo de como usar a classe TEmailSender:
var
email: TEmailSender;
begin
email := TEmailSender.Create;
try
email.SMTPHost := 'smtp.seuservidor.com';
email.SMTPPort := 587;
email.SMTPUsername := '[email protected]';
email.SMTPPassword := 'suasenha';
email.FromAddress := '[email protected]';
email.ToAddress := '[email protected]';
email.Subject := 'Teste de envio de e-mail com anexo';
email.Body := 'Este é um teste de envio de e-mail com anexo';
email.AttachmentFilePath := 'c:\arquivoanexo.pdf';
try
email.SendEmail;
except
on E: Exception do
ShowMessage('Erro ao enviar e-mail: ' + E.Message);
end;
finally
email.Free;
end;
end;
Get in touch with us for any questions or inquiries through WhatsApp: https://wa.me/5597991442486
Entre em contato conosco para qualquer dúvida ou pergunta pelo WhatsApp: https://wa.me/5597991442486
Donate via PIX:
Email: [email protected]
Faça sua doação via PIX:
Email: [email protected]
Get to know us better on our YouTube channel:
>> FIND OUT MORE
Conheça mais sobre nós em nosso canal no YouTube:
>> CONHEÇA MAIS
This project is licensed under the GPL-3.0 License. See LICENSE for more details.
Este projeto está licenciado sob a Licença GPL-3.0. Veja LICENSE para mais detalhes.