Gmail - Read Email

Get plain text:

curl -H "Accept: text/plain" https://jugoya.ai/guides/gmail/read-email

Overview

Read, compose, and manage emails in Gmail (mail.google.com). Includes inbox navigation, email reading, composing, search, and attachment download workflows.

URLs

PageURLPurpose
Inboxhttps://mail.google.com/mail/u/0/#inboxMain inbox view
Starredhttps://mail.google.com/mail/u/0/#starredStarred emails
Senthttps://mail.google.com/mail/u/0/#sentSent emails
Draftshttps://mail.google.com/mail/u/0/#draftsDraft emails
Searchhttps://mail.google.com/mail/u/0/#search/{query}Search results

Critical Constraints

  • Authentication Required: Must be logged into Google account
  • Dynamic DOM: Gmail continuously updates its DOM even without page navigation - element references may become invalid quickly
  • Large Page State: Gmail pages contain many elements - use targeted element selection
  • Truncated Previews: Email list shows truncated previews, not full content
  • Long Emails: May require scrolling to view full content

Workflow: Read Email

1. Navigate to Inbox

Navigate to https://mail.google.com/mail/u/0/#inbox

2. Identify Target Email

Find email items in the list. Each email row contains:

  • Checkbox (for selection)
  • Star button
  • Sender name
  • Subject line (clickable link)
  • Snippet preview
  • Date/time

3. Click the Email Link

Important: Click the subject line link element, not the checkbox or row background.

Each email row contains multiple interactive elements:

ElementDescriptionClick behavior
CheckboxSelection input at row startSelects email for bulk actions
StarButton next to checkboxStars/unstars the email
Subject linkClickable text with subjectOpens the email

4. Read Email Content

The email opens in the main content area. Key elements:

  • Subject line at the top
  • Sender information (name, email address, timestamp)
  • Email body with full message content
  • Attachments listed at the bottom if present

Workflow: Compose Email

1. Open Compose Window

Click the "Compose" button in the left sidebar.

2. Fill Email Fields

FieldDescription
ToRecipient email addresses
Cc/BccClick "Cc" or "Bcc" to reveal fields
SubjectEmail subject line
BodyRich text editor for message content

3. Add Attachments (Optional)

  1. Click the attachment icon (paperclip) in the compose toolbar
  2. Select file(s) to attach from your computer
  3. Wait for upload to complete

4. Send Email

Click the "Send" button to send the email.

Workflow: Search Emails

1. Access Search

Click the search box at the top of Gmail.

2. Enter Search Query

Type search terms. Gmail searches:

  • Subject lines
  • Email body content
  • Sender/recipient names
  • Attachment names

3. Use Search Operators (Optional)

OperatorExampleDescription
from:from:sender@example.comEmails from specific sender
to:to:recipient@example.comEmails to specific recipient
subject:subject:meetingEmails with word in subject
has:attachmenthas:attachmentEmails with attachments
after:after:2025/01/01Emails after date
before:before:2025/12/31Emails before date

4. Navigate Results

Search results appear in list format. Click on any email to open it.

Direct Search URL: https://mail.google.com/mail/u/0/#search/from%3Asender+keyword

Workflow: Download Attachments

1. Open Email with Attachment

Navigate to and open an email that contains attachments.

2. Locate Attachments

Attachments appear at the bottom of the email content, showing:

  • File name
  • File size
  • File type icon

3. Download Attachment

  • Hover over the attachment to reveal action buttons
  • Click the download icon to save the file
  • For multiple attachments, click "Download all" if available

Keyboard Shortcuts

Gmail keyboard shortcuts may not work reliably via browser automation. Prefer direct clicking.

ShortcutAction
cCompose new email
jMove to next email in list
kMove to previous email in list
o or EnterOpen selected email
uReturn to inbox list
rReply to email
aReply all
fForward email
eArchive email
#Delete email
/Focus search box

Page Structure Reference

Inbox View Elements

ElementDescription
Compose buttonLeft sidebar, creates new email
Email listMain content area, rows of emails
Email rowContains checkbox, star, sender, subject, snippet, date
Search boxTop of page, search input
Folder labelsLeft sidebar navigation (Inbox, Starred, Sent, etc.)

Email View Elements

ElementDescription
Subject lineTop of email content
Sender infoName, email address, timestamp
Email bodyMain message content
AttachmentsBottom of email, file cards
Reply buttonBelow email content
Forward buttonBelow email content

Troubleshooting

IssueCauseSolution
Element not foundGmail's dynamic DOM invalidated referenceRe-query the page for fresh element references
Click does nothingClicked checkbox instead of subject linkTarget the subject link element specifically
Email list not loadingSlow connection or auth issueWait longer or refresh page
Email content truncatedNeed to scrollScroll down within email view
Attachments not visibleNeed to scroll downScroll to bottom of email
Persistent click failuresBrowser state issueRestart browser or navigate fresh

Notes

  • Gmail may redirect to locale-specific URL (e.g., /mail/u/0/ for primary account)
  • Multiple account users: Change u/0 to u/1, u/2 for other accounts
  • Labels can be accessed via #label/{label-name} URL format
  • Gmail's dynamic DOM means element references can become stale - always query fresh before interacting