- Newest
- Most votes
- Most comments
Root Cause The error: SESServiceException [ValidationError]: Value at 'source' failed to satisfy constraint: Member must not be null means the Source (i.e., the FromEmailAddress) is undefined or null when passed to SES, despite your Lambda logging the correct value. This is not an IAM issue or a sandbox limit (yet).
Most Likely: The FROM_EMAIL environment variable might be missing, misnamed, or have an invisible character (like a space or newline). console.log() might show a value, but that doesn’t mean it’s valid when passed into the actual SDK call. SES needs an explicit, non-empty string for the Source field; even one small issue can break it.
Cross Check: Your Lambda is running in the same region as SES (us-east-2 in your case) The FROM_EMAIL is verified in SES You’re using the correct name in your Lambda env vars; even a typo or case difference can silently fail
Based on the information provided, it appears you're encountering a validation error in your Lambda function when trying to send emails via Amazon SES, despite successful tests from the SES console.
The error message "Value at 'source' failed to satisfy constraint: Member must not be null" specifically indicates that the 'source' parameter (which is the sender's email address) is either missing or null when your Lambda function attempts to send the email.
Here are some potential causes and solutions:
-
Environment Variable Issues: While you mentioned that your environment variables are correctly read in Lambda logs, there might be an issue with how they're being accessed or processed in your code. Double-check that the FROM_EMAIL value is properly assigned to the 'source' field in your SendEmailCommand parameters.
-
Code Execution Flow: There might be a conditional statement or asynchronous operation in your code that's causing the source parameter to be undefined when the SendEmailCommand is executed. Ensure that your environment variables are fully loaded before attempting to send the email.
-
Parameter Structure: Verify that your params object is correctly structured according to the SES API requirements. The 'source' field needs to be properly defined in the SendEmailCommand parameters.
-
Lambda Execution Context: Lambda functions can sometimes behave differently than local environments due to the execution context. Make sure your code handles any potential race conditions or timing issues.
-
SES Sandbox Restrictions: While in the SES sandbox, you can only send emails to verified addresses. Ensure that both your sender and recipient addresses are verified in SES. This is different from the console test, which might have different verification requirements.
To troubleshoot further:
- Add more detailed logging right before the SendEmailCommand call to verify the exact structure of your params object
- Try hardcoding the source email address directly in your code (temporarily) to see if that resolves the issue
- Check if there are any transformations or manipulations of the environment variables that might be causing the source to become null
- Ensure your Lambda function has enough execution time and memory allocated
If these steps don't resolve the issue, requesting production access might help, but it's important to fix the underlying validation error first, as it suggests a code or configuration issue rather than a sandbox limitation.
Sources
sending email from lambda function within private subnet in vpc | AWS re:Post
Getting "Unverified" when sending emails with AWS SES using a verified email with my company domain | AWS re:Post
Send Mail on AWS Lambda NodeJS with Nodemailer | AWS re:Post
I agree, the logs show that FROM_EMAIL is being read and passed correctly. But from past experience, SES’s "ValidationError: source must not be null" error can still happen in cases where the value looks right but fails internal validation especially if:
The email isn’t verified in the same region (us-east-2)
The SDK request silently fails due to encoding issues or invisible characters
The SES sandbox enforces more strict validation via the SDK/API than what the Console UI does
Even if the email is technically present, SES may be rejecting it before it hits the sending phase.
To move forward, I’d suggest testing:
Wrapping process.env.FROM_EMAIL in .trim() (just in case)
Confirming the email is verified in us-east-2
Trying sendRawEmail() instead of sendEmail() , that sometimes helps isolate whether the issue is with request structure vs. SES identity checks.
Totally understand where you're coming from, and agree the error message is misleading.
answered a year ago
Relevant content
- AWS OFFICIALUpdated 2 years ago

Based on the CloudWatch logs I've reviewed, I can confidently rule out the FROM_EMAIL environment variable being undefined, null, misnamed, or containing invisible characters at the point of the SES SDK call.
Here's why:
This situation strongly suggests that the issue is external to Lambda's code:
It points back to a behavior within the AWS SES service itself, specifically when operating in the sandbox mode. The fact that sending from the SES console works, but sending from your Lambda (with correct IAM permissions and correct parameters + clearly verified email on the console) does not, highlights a distinction in how SES processes requests originating from different sources in the sandbox. I was thinking that the ValidationError message might be misleading in this context, as the value for source is clearly not null.