action-send-mail
action-send-mail copied to clipboard
How to use SES to send emails for job failure
I am using the below code snippet for sending emails for action status using AWS SES. But i am keep facing issue fro from address
if: always()
uses: dawidd6/action-send-mail@v3
with:
# mail server settings
server_address: ${{secrets.SMTP_HOST}}
server_port: 465
# Optional (recommended): mail server username:
username: ${{secrets.SMTP_USERNAME}}
# Optional (recommended) mail server password:
password: ${{secrets.SMTP_PASSWORD}}
# email subject
subject: ${{ github.job }} job of ${{ github.repository }} has ${{ job.status }}
# email body as text
body: ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}
# comma-separated string, send email to
to: [email protected]
# from email name
from: [email protected]
So what is the issue?
@dawidd6 i am getting the error lik below
FYI i opened ticket in stackoverflow as well..it would be great help if you could help me to sort it out..
the from
and to
and domain all three are already verifed in AWS SES. also we are not in sandbox
https://stackoverflow.com/questions/73081286/get-email-notification-from-github-actions-failure-using-aws-ses
Thankyou Muneesh
@dawidd6 i used the above format but still getting same error. Any idea on this?
I gave like this but still failing...any idea...as i told before we are using AWS SES with SMTP credentials.
@dawidd6 thankyou very much for your time..i made it work
Maybe post the solution here that worked for you, so anyone else won't need to ask same question again.
@dawidd6 I had the same issue when trying to send email from AWS SES. It seems the from field in the action needs to be explicitly set to the format:
from: username <[email protected]>
I think that AWS is angry about the double quotes encapsulating the name.
Thanks for the solution, closing.