Message Submission |
Top Previous Next |
To submit a mail message in message/rfc822 format, such as from email service web hooks, use the postmail endpoint.
Request Format
Endpoint: /api/postmail
The submission can be in PUT or POST format, with one of these structures:
•Content-type message/rfc822, the post body must be in RFC822 message format •Content-type application/json, the post body must be in JSON format with a field named "email" that contains the RFC822 message •Content-type multipart/form-data, the post body message be in multipart/form-data format with a field named "email" that contains the RFC822 message
The response to this post will be an error 400 if the message cannot be parsed, or a 200 if it can be parsed, even if not delivered. Delivery or non-delivery is logged in the server logs.
An example of this usage is with the SendGrid inbound parse web hook. In this case, be sure to select the Send Raw option, so that the multipart/form-data posted message includes the "email" field.
|