action-send-mail icon indicating copy to clipboard operation
action-send-mail copied to clipboard

How to use SES to send emails for job failure

Open Muneeshbiologit opened this issue 2 years ago • 7 comments

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]

Muneeshbiologit avatar Jul 22 '22 11:07 Muneeshbiologit

So what is the issue?

dawidd6 avatar Jul 22 '22 15:07 dawidd6

@dawidd6 i am getting the error lik below

image

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

Muneeshbiologit avatar Jul 22 '22 15:07 Muneeshbiologit

Try:

from: Name Surname <[email protected]>

dawidd6 avatar Jul 22 '22 21:07 dawidd6

@dawidd6 i used the above format but still getting same error. Any idea on this? image

I gave like this but still failing...any idea...as i told before we are using AWS SES with SMTP credentials.

Muneeshbiologit avatar Jul 23 '22 04:07 Muneeshbiologit

@dawidd6 thankyou very much for your time..i made it work

Muneeshbiologit avatar Jul 24 '22 12:07 Muneeshbiologit

Maybe post the solution here that worked for you, so anyone else won't need to ask same question again.

dawidd6 avatar Jul 24 '22 15:07 dawidd6

@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.

joynerar avatar Aug 02 '22 04:08 joynerar

Thanks for the solution, closing.

dawidd6 avatar Sep 22 '22 09:09 dawidd6