landgraf-dev / aws-sdk-delphi

AWS (Amazon Web Services) SDK for Delphi.
Other
125 stars 31 forks source link

I need help, How to pass credentials to AmazonSimpleEmailServiceClient #16

Open roubledodemiamgasoni opened 5 months ago

roubledodemiamgasoni commented 5 months ago

What I have to do, I need an example passing the credentials via code.

var
  Client: IAmazonSimpleEmailService;
  Request: ISendEmailRequest;
  Response: ISendEmailResponse;
begin
  // 2. Instantiate client interface

  Client := TAmazonSimpleEmailServiceClient.Create;

  //Client := TAmazonSQSClient.Create('myAccessKey', 'mySecretKey');
  // 3. Create and fill the request
  Request := TSendEmailRequest.Create;

  Request.Source := vg_EmailConfig.Remetente;
  Request.Destination := TDestination.Create;
  Request.Destination.ToAddresses.Add(Destinatarios);
  Request.Message := TMessage.Create(
    TContent.Create(Assunto),
    TBody.Create(TContent.Create(Mensagem)));

  // 4. Call operation method passing the request to receive the response;
  Response := Client.SendEmail(Request);
wlandgraf commented 5 months ago

You just pasted the example. Just replace myAcessKey and mySecretKey with your own AWS Access ID and Secret, respectively.