Loading...


Related Products


Date Published: September 27, 2023

Cron jobs not sending email when using Platform Email

Issue

Your application has scheduled cron jobs that should be sending email, but email is not being sent out. This could be accompanied by an error message that looks like this:

ERROR: MessageId=, 
EnvUuid=aabbccdd-1234-1212-abab-3434abcde,
ClientId=aabbccdd-1234-1212-abab-3434abcde,
Status=ERROR,
To=123456abcdef123456abcdef123456abcdef,
From=789123fdaabc789123fdaabc789123fdaabc,
ErrorMessage=AccessDenied : User `arn:aws:iam::123456789

Resolution

You need to modify your cron job command line or script(s) (or both) to use a "From:" email address that matches the domain you have configured and validated within your Subscription's Platform Email settings in the Cloud UI. 

A common case is having a mail command as a cronjob. For example:

cat text_file_I_want_to_send.txt | mail -s "My Mail Subject" [email protected]

The above will not work, because you have not specified a "From" address. You would need to specify it AND it must match one of the domains in your Platform Email settings. If, for example, you have properly validated the mail.myorganization.com domain with Platform Email (by specifying all the TXT/MX/CNAME entries and going through the validation process), then you could alter your above command by adding the argument -r [email protected] to the mail command:

cat text_file_I_want_to_send.txt | mail -s "My Mail Subject" [email protected] -r [email protected]
 

Cause

Any and all mail sent through Platform Email requires a From: address that comes from a domain you have configured and validated within your Subscription's Platform Email settings in the Cloud UI. 

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation