Skip to content

gmail send: display name not included in From header #436

@kingrubic

Description

@kingrubic

Summary

When sending emails via gog gmail send, the From header only contains the bare email address (e.g., bemiagent@gmail.com) instead of including the display name configured in Gmail's "Send mail as" settings (e.g., "Bé Mi Agent" <bemiagent@gmail.com>).

Steps to Reproduce

  1. Configure a display name in Gmail Settings → Accounts → "Send mail as"
  2. Send an email using gog:
    gog gmail send -a bemiagent@gmail.com --to recipient@gmail.com --subject "Test" --body "Hello"
  3. Check the received email's From header

Expected Behavior

The From header should include the display name from Gmail's Send-As settings:
From: "Bé Mi Agent" bemiagent@gmail.com

Actual Behavior

The From header only contains the bare email:
From: bemiagent@gmail.com
Sending the same email manually from Gmail web UI correctly shows the display name.

Workaround

Using the raw Gmail API (messages.send with a base64-encoded RFC 2822 message that includes the display name in the From header) works correctly.

Possible Fix

Before calling messages.send, gog could:

  1. Fetch the user's Send-As settings via GET /gmail/v1/users/me/settings/sendAs to get the configured display name
  2. Include the display name in the raw message's From header using RFC 2822 format: "Display Name" <email@example.com>

Alternatively, a --from-name flag could allow users to specify the display name explicitly.

Environment

  • gog version: v0.10.0 (a92bd63 2026-02-14)
  • OS: macOS (ARM64)
  • Account type: Personal Gmail

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions