Symptom: Grant is unable to send emails via API and returns error 'grant is missing imap username or password or smtphost or smtpport, unable to fetch connection details'
This error is returned when the grant does not have any valid SMTP settings. This happens because the SMTP settings are optional during authentication.
This article is for how you can force the SMTP settings during authentication.
Answer
Proactive IMAP Configuration Validation with options=smtp_required
One of the most common pain points in email integrations is discovering missing SMTP configuration only after users attempt to send their first email. This reactive approach leads to poor user experience and increased support burden. Nylas now provides a proactive solution through the options=smtp_required parameter.
The Problem: Reactive SMTP Validation
Traditionally, IMAP authentication validates only incoming mail settings (IMAP host/port), while SMTP configuration for outgoing mail remains unchecked until the first send attempt. This creates a gap where grants appear valid but lack essential sending capabilities, resulting in errors like:
'grant is missing imap username or password or smtphost or smtpport, unable to fetch connection details'
The Solution: Mandatory SMTP Configuration
The options=smtp_required parameter transforms IMAP authentication from reactive to proactive by requiring complete email configuration upfront.
Implementation
Add the parameter to your hosted authentication URL:
US Region:
https://api.us.nylas.com/v3/connect/auth?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&provider=imap&options=smtp_required
EU Region:
https://api.eu.nylas.com/v3/connect/auth?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code&provider=imap&options=smtp_required
This feature transforms potential runtime email sending failures into upfront validation, creating more reliable IMAP integrations with complete configuration from the start.
Need Help?
If you're facing any issues while implementing this feature, please contact Nylas support for assistance.
Updated
Comments
0 comments
Please sign in to leave a comment.