Generate a QR Code for Email (mailto)
Create a QR code that opens the user's email client with a pre-filled recipient, subject, and body. Covers the mailto: URI scheme, URL encoding, multi-recipient support, and character limits.
Detailed Explanation
QR Codes for Email (mailto)
A mailto QR code encodes an email address using the mailto: URI scheme. When scanned, the device opens the default email client with pre-filled fields — recipient, subject, body, CC, and BCC.
The mailto URI Format
The basic format is:
mailto:support@example.com
To include a subject and body:
mailto:support@example.com?subject=Feedback&body=Hello%2C%0AI%20have%20a%20question.
Supported Parameters
| Parameter | Description | Example |
|---|---|---|
| (address) | Recipient email | mailto:user@example.com |
subject |
Email subject line | ?subject=Hello |
body |
Email body text | &body=Message%20here |
cc |
Carbon copy recipients | &cc=other@example.com |
bcc |
Blind carbon copy | &bcc=hidden@example.com |
URL Encoding Rules
Special characters in the subject and body must be percent-encoded:
| Character | Encoded |
|---|---|
| Space | %20 |
| Newline | %0A |
| Comma | %2C |
| Ampersand | %26 |
| Question mark | %3F |
Multiple Recipients
Separate multiple addresses with commas:
mailto:alice@example.com,bob@example.com?subject=Team%20Meeting
Practical Limits
While the mailto specification does not define a maximum length, keep the total URI under 500 characters. Long email bodies should be avoided — instead, provide a brief prompt and let the user fill in details.
Platform Behavior
- iOS — Opens Mail app by default. If Gmail or Outlook is set as default, those are used instead.
- Android — Shows an app chooser if multiple email apps are installed.
- Desktop — Opens the system default email client (Outlook, Thunderbird, etc.).
Security Note
The mailto scheme cannot attach files or execute scripts. It is safe by design — the user always reviews the composed email before sending.
Use Case
Email QR codes are used on product packaging for support requests, event badges for quick follow-up emails, printed surveys that open a feedback email, customer support kiosks, and business cards as an alternative to vCard when only email contact is needed.