I’m sending from HTML via Mailgun. The server builds the content and sends it to Mailgun. there are a few caveats, maily if the recipient is using Outlook as it can be a real PITA for formatting and compatability. For example, I build PNGs on my server before sending because SVGs end-up broken in Outlook, but most other (AKA modern) clients handle SVG with ease.
Also, as s Mike said, you need to configure properly, and it seems that DMARC settings at the key to getting clean deliveries.