Is this library able to collect SMTP traffic infos? #134
-
I had a app sending emails based on python, I want to switch to golang but a lot of libraries lack of transport infos. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @Dennis-Zhang-SH, glad you're interested in using go-mail. The package does indeed allow for transport logging. Since v0.3.9, we've added a debug logging option which allows you to see the communication between the server and the client. Some details and an example screenshot can be found in the PR if that helps: #102 |
Beta Was this translation helpful? Give feedback.
-
Can this log info been collected as string? I may need to save it in the database. |
Beta Was this translation helpful? Give feedback.
-
Oh okay just found it, that would be great. |
Beta Was this translation helpful? Give feedback.
The debug logging feature implements a simple logging interface, so you can provide a custom logger instead of the provided simple logger, we're shipping with the package. As long as your custom logger implements that interface, you should be ready to go. Just build a logging function that takes the provided string and stores it in a database.