go-mail icon indicating copy to clipboard operation
go-mail copied to clipboard

Support reading outgoing QueueID

Open sapmli opened this issue 9 months ago • 4 comments

Is your feature request related to a problem? Please describe.

Email clients often need to store the outgoing QueueID, that means the ID the remote relay accepted the email under. So that for email tracing purposes you have a reference.

In https://github.com/wneessen/go-mail/blob/main/smtp/smtp.go#L403, the message sent along a 250 response code is discarded.

Describe the solution you'd like

A solution might be to introduce a callback, or to store the message in the client, where the caller might fetch it from after the datacloser.Close() call.

The latter avoids a breaking change in the API, so it might be the simpler one.

Describe alternatives you've considered

No response

Additional context

No response

sapmli avatar Jan 30 '25 09:01 sapmli