---
title: "Cron jobs not sending email when using Platform Email"
date: "2023-09-27T17:50:11+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92631-cron-jobs-not-sending-email-when-using-platform-email"
id: "c4dcc0ea-ef3d-4427-9a0f-b282b6a31439"
---

Table of contents will be added

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" someone@myorganization.com**  
  
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 noreply@mail.myorganization.com** to the **mail** command:  
  
**cat text\_file\_I\_want\_to\_send.txt | mail -s "My Mail Subject" someone@myorganization.com -r whatever@mail.myorganization.com**  
 

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.