Method
func (s *ReceivingSvcImpl) GetAttachment(emailId string, attachmentId string) (*EmailAttachment, error)
func (s *ReceivingSvcImpl) GetAttachmentWithContext(ctx context.Context, emailId string, attachmentId string) (*EmailAttachment, error)
Access via: client.Emails.Receiving.GetAttachment(emailId, attachmentId)
Parameters
The unique identifier of the received email
The unique identifier of the attachment
Response
Always "email_attachment"
The unique identifier of the attachment
The filename of the attachment
The MIME type of the attachment
The content disposition header value
The content ID for inline attachments
Temporary URL to download the attachment file
ISO 8601 timestamp of when the download URL expires
Example
client := resend.NewClient("re_123456789")
attachment, err := client.Emails.Receiving.GetAttachment("email_abc123", "att_xyz789")
if err != nil {
panic(err)
}
fmt.Println("Filename:", attachment.Filename)
fmt.Println("Content Type:", attachment.ContentType)
fmt.Println("Download URL:", attachment.DownloadUrl)
fmt.Println("Expires At:", attachment.ExpiresAt)
// Download the attachment using the URL
// resp, err := http.Get(attachment.DownloadUrl)