Skip to main content

Method

func (s *ReceivingSvcImpl) Get(emailId string) (*ReceivedEmail, error)
func (s *ReceivingSvcImpl) GetWithContext(ctx context.Context, emailId string) (*ReceivedEmail, error)
Access via: client.Emails.Receiving.Get(emailId)

Parameters

emailId
string
required
The unique identifier of the received email

Response

Id
string
The unique identifier of the email
Object
string
Always "email"
To
[]string
Array of recipient email addresses
From
string
The sender’s email address
CreatedAt
string
ISO 8601 timestamp of when the email was received
Subject
string
The email subject line
Html
string
The HTML content of the email
Text
string
The plain text content of the email
Bcc
[]string
Array of BCC recipient addresses
Cc
[]string
Array of CC recipient addresses
ReplyTo
[]string
Array of reply-to addresses
Headers
map[string]string
Email headers as key-value pairs
MessageId
string
The email message ID
Attachments
[]ReceivedAttachment
Array of attachment metadata
Id
string
The unique identifier of the attachment
Filename
string
The filename of the attachment
ContentType
string
The MIME type of the attachment
ContentDisposition
string
The content disposition header value
ContentId
string
The content ID for inline attachments
Raw
RawEmail
Access to the raw email file
DownloadUrl
string
Temporary URL to download the raw email
ExpiresAt
string
When the download URL expires

Example

client := resend.NewClient("re_123456789")

email, err := client.Emails.Receiving.Get("email_abc123")
if err != nil {
    panic(err)
}

fmt.Println("Subject:", email.Subject)
fmt.Println("From:", email.From)
fmt.Println("HTML Content:", email.Html)
fmt.Println("Text Content:", email.Text)

for _, attachment := range email.Attachments {
    fmt.Printf("Attachment: %s (%s)\n", attachment.Filename, attachment.ContentType)
}

Build docs developers (and LLMs) love