Skip to main content

 hi team I want to send a mail in a job and I'm using SendEmailWithAttachment but it is showing this error and I'm not able to figure out what the issue is here.

putting the code and the error

 

HtmlResult=(Data_.to_html(classes='table table-stripped'))
subject="Unaction Data"
recipients="my email id"
message = HtmlResult
attachment_file_name="N/A"
attachment_content="N/A"
siemplify.send_mail(subject, message, recipients, attachment_file_name, attachment_content)​

 

ERROR:root:An error occurred: 500 Server Error: Internal Server Error for url: http://server:80/api/external/v1/sdk/SendEmailWithAttachment/?format=snake: b'{"errorCode":2000,"errorMessage":"An error occurred. Please contact your system administrator.","innerException":null,"innerExceptionType":null}'

 

 
   

Not exactly this scenario but I may be able to help with pointers I've encountered with this error before.

Specifically the API, you often receive a server error if parameters it was expecting to do not fall within the right data type for that field.

Reviewing the send mail usage I have in a custom job - and the above code - could you check the data types of everything you are passing to the send_mail function - specifically it is expecting an array type for recipients:

https://cloud.google.com/chronicle/docs/soar/reference/siemplify-job-module#send_mail

Hope this helps!

Cheers

K


Since it's a generic error it's hard to troubleshoot without more specific details. I would recommend you open a support case but as mentioned by the comment above please ensure the recipients variable is a array not a string. 


Reply