You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just found an interesting issue. In my scenario I first call Msg.Write to log message contents to debug logger and after that Msg.WriteToSendmailWithContext does not populate body of the message. Removing first call to Msg.Write or making two sequential calls to Msg.Write proves that. It seems that underlying writer shifts its current position to the end of buffer preventing body from being read second time. In original gomail this works normally. Didn't have much time to look into it.
The text was updated successfully, but these errors were encountered:
Thanks for the report. You are right... we were using io.Copy to write to the body string/alternative string to the io.Writer. This placed the byte position of the buffer to be at the EOF after the first WriteTo() call leaving the output of a 2nd call to WriteTo() empty.
Just found an interesting issue. In my scenario I first call
Msg.Write
to log message contents to debug logger and after thatMsg.WriteToSendmailWithContext
does not populate body of the message. Removing first call toMsg.Write
or making two sequential calls toMsg.Write
proves that. It seems that underlying writer shifts its current position to the end of buffer preventing body from being read second time. In originalgomail
this works normally. Didn't have much time to look into it.The text was updated successfully, but these errors were encountered: