import sendgrid
import os

api_key = os.environ["SENDGRID_APIKEY"]

sg = sendgrid.SendGridAPIClient(api_key)
data = {
  "personalizations": [
    {
      "to": [
        {
          "email": "774@id774.net"
        }
      ],
      "subject": "テストです"
    }
  ],
  "from": {
    "email": "774@id774.net"
  },
  "content": [
    {
      "type": "text/plain",
      "value": "テストメールの送信です"
    }
  ]
}
response = sg.client.mail.send.post(request_body=data)

print(response.status_code)
print(response.body)
print(response.headers)

03f7e8e835d1ecd535d19d30a25fd07df8e80043
<mask token>

<mask token>
print(response.status_code)
print(response.body)
print(response.headers)

<mask token>
api_key = os.environ['SENDGRID_APIKEY']
sg = sendgrid.SendGridAPIClient(api_key)
data = {'personalizations': [{'to': [{'email': '774@id774.net'}], 'subject':
    'テストです'}], 'from': {'email': '774@id774.net'}, 'content': [{'type':
    'text/plain', 'value': 'テストメールの送信です'}]}
response = sg.client.mail.send.post(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)

import sendgrid
import os
api_key = os.environ['SENDGRID_APIKEY']
sg = sendgrid.SendGridAPIClient(api_key)
data = {'personalizations': [{'to': [{'email': '774@id774.net'}], 'subject':
    'テストです'}], 'from': {'email': '774@id774.net'}, 'content': [{'type':
    'text/plain', 'value': 'テストメールの送信です'}]}
response = sg.client.mail.send.post(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)

import sendgrid
import os

api_key = os.environ["SENDGRID_APIKEY"]

sg = sendgrid.SendGridAPIClient(api_key)
data = {
  "personalizations": [
    {
      "to": [
        {
          "email": "774@id774.net"
        }
      ],
      "subject": "テストです"
    }
  ],
  "from": {
    "email": "774@id774.net"
  },
  "content": [
    {
      "type": "text/plain",
      "value": "テストメールの送信です"
    }
  ]
}
response = sg.client.mail.send.post(request_body=data)

print(response.status_code)
print(response.body)
print(response.headers)
