{"id":28352,"library":"tencentcloud-sdk-python-ses","title":"Tencent Cloud SES SDK for Python","description":"Official Tencent Cloud SDK for Simple Email Service (SES). Version 3.1.85. Part of the Tencent Cloud Python SDK with product-specific packages; released frequently alongside the main SDK. Requires a Tencent Cloud secret ID and key for authentication.","status":"active","version":"3.1.85","language":"python","source_language":"en","source_url":"https://github.com/TencentCloud/tencentcloud-sdk-python","tags":["tencentcloud","ses","email","sdk","python"],"install":[{"cmd":"pip install tencentcloud-sdk-python-ses","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Common SDK base with client classes and authentication","package":"tencentcloud-sdk-python-common","optional":false}],"imports":[{"note":"Old import path does not include API version; leads to ModuleNotFoundError","wrong":"from tencentcloud.ses import SesClient","symbol":"SesClient","correct":"from tencentcloud.ses.v20201002 import ses_client"},{"note":"Models must be imported from the versioned subpackage","wrong":"from tencentcloud.ses import models","symbol":"SendEmailRequest","correct":"from tencentcloud.ses.v20201002 import models"}],"quickstart":{"code":"import os\nfrom tencentcloud.common import credential\nfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\nfrom tencentcloud.ses.v20201002 import ses_client, models\n\ntry:\n    cred = credential.Credential(\n        os.environ.get('TENCENTCLOUD_SECRET_ID', ''),\n        os.environ.get('TENCENTCLOUD_SECRET_KEY', '')\n    )\n    client = ses_client.SesClient(cred, 'ap-guangzhou')\n    req = models.SendEmailRequest()\n    req.FromEmailAddress = 'sender@example.com'\n    req.Destination = ['recipient@example.com']\n    req.Subject = 'Test'\n    req.Simple = models.Simple()\n    req.Simple.Subject = 'Test'\n    req.Simple.HtmlBody = '<p>Hello</p>'\n    resp = client.SendEmail(req)\n    print(resp.RequestId)\nexcept TencentCloudSDKException as err:\n    print(err)","lang":"python","description":"Send a simple email using SES client with secret id/key from environment variables."},"warnings":[{"fix":"Use from tencentcloud.ses.v20201002 import ses_client, models","message":"All requests require an API version suffix in the import path (v20201002). Using tencentcloud.ses without the version will cause ModuleNotFoundError.","severity":"gotcha","affected_versions":">=2.x"},{"fix":"Instantiate client with SesClient(cred, region) and call methods with request objects.","message":"The SDK old instance-based client (e.g., TencentCloudAPI) is deprecated. Use the request-style (client + request object) pattern.","severity":"deprecated","affected_versions":">=3.0"},{"fix":"Always pass a region string (e.g., 'ap-guangzhou') to the client constructor.","message":"Region must be explicitly set, even if using default. Some users omit region and get connection errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"pip install tencentcloud-sdk-python-ses","cause":"Installing the common package but forgetting the product-specific package.","error":"ModuleNotFoundError: No module named 'tencentcloud.ses.v20201002'"},{"fix":"Use: from tencentcloud.ses.v20201002 import ses_client","cause":"Importing from the non-versioned module.","error":"AttributeError: module 'tencentcloud.ses' has no attribute 'ses_client'"},{"fix":"Ensure all mandatory fields are set: FromEmailAddress, Destination, Subject, and either Simple or Template.","cause":"Required fields missing or incorrect in the request model (e.g., no Subject or Destination).","error":"TencentCloudSDKException: [InvalidParameter] InvalidParameterValue"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}