簡體   English   中英

Aws::SES::Errors::InvalidParameterValue:嵌套組 ruby send_raw_email with attachments

[英]Aws::SES::Errors::InvalidParameterValue: Nested group ruby send_raw_email with attachments

當我使用 ruby 的 aws ses 文檔時說: https://www.rubydoc.info/gems/aws-sdk-ses/1.14.0/Aws%2FSES%2FClient:send_raw_email

我嘗試了該代碼並給我那個錯誤:Aws Aws::SES::Errors::InvalidParameterValue: Nested group

我嘗試使用 send_raw_email 發送send_raw_email但使用來自 AWS SES 的文檔 ruby 當我在程序返回的文檔中測試該代碼時: Aws::SES::Errors::InvalidParameterValue: Nested group and not send email

這是插值的問題,我用這個解決了這個問題:

# open and read archive to send in attachment
file = File.open(path_from_csv_created).read

resp = ses_client.send_raw_email(
      source: 'email_send',
      destinations: ['email_to_receive'],
      raw_message: {
        data: <<~MESSAGE
          From: email_send
          To: email_to_receive
          Subject: Test email (contains an attachment)
          MIME-Version: 1.0
          Content-type: Multipart/Mixed; boundary="NextPart"

          --NextPart
          Content-Type: text/plain

          bodyyyy

          --NextPart
          Content-Type: application/csv;
          Content-Disposition: attachment; filename="#{file_csv_name}"

          #{file}
        MESSAGE
      }
    )

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM