PHP gửi mail HTML qua Mailtrap Email API

Endpoint đang dùng: https://send.api.mailtrap.io/api/send. Token lấy từ biến môi trường MAILTRAP_API_KEY.

Nếu bạn chỉ cần HTML thì để Text trống cũng được.


Nếu bạn bị lỗi “rejected/unverified domain”: Mailtrap yêu cầu verify sending domain trước khi gửi thật. :contentReference[oaicite:2]{index=2}