Fix sending attachments with less than 512 bytes
This commit is contained in:
parent
bb620e0900
commit
c9a909fee3
|
@ -409,7 +409,7 @@ func writeAttachment(path string, writer *mail.Writer) error {
|
||||||
// determine the MIME type
|
// determine the MIME type
|
||||||
// http.DetectContentType only cares about the first 512 bytes
|
// http.DetectContentType only cares about the first 512 bytes
|
||||||
head, err := reader.Peek(512)
|
head, err := reader.Peek(512)
|
||||||
if err != nil {
|
if err != nil && err != io.EOF {
|
||||||
return errors.Wrap(err, "Peek")
|
return errors.Wrap(err, "Peek")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue