Time-limited reset tokens with device and location context. Reliable instant delivery prevents lockouts and reduces support volume.
Delayed password reset emails lock users out of their accounts and generate avoidable support tickets. Every minute a user waits for a reset email is a minute they might abandon your product. Beyond speed, reset emails must include security context — device, location, IP — to help users identify unauthorized reset attempts. Getting both right requires reliable, instant infrastructure.
MultiMail's AI agent handles password reset emails with the urgency and reliability they require. When a reset request arrives, the agent generates a time-limited token, composes an email with security context (IP, browser, location), and sends it immediately under autonomous oversight. The API's reliability ensures reset emails arrive within seconds, preventing lockouts.
Your application sends a password reset event to the AI agent when a user clicks 'Forgot Password.' The event includes the user's email, IP address, browser, and location data.
Your application generates a cryptographic reset token with a short expiration window (typically 15-30 minutes) and creates the reset URL.
The agent includes the reset link alongside security context: the IP address, browser, and approximate location of the requester. This helps users identify unauthorized reset attempts.
Under autonomous oversight, the reset email is sent instantly via send_email. Speed is critical — every second of delay increases the risk of user abandonment or duplicate requests.
import requests
API = "https://api.multimail.dev/v1"
HEADERS = {"Authorization": "Bearer mm_live_xxx"}
def send_password_reset(user: dict, request_context: dict):
reset_url = generate_reset_url(user["id"])
body = (
f"Hi {user[&"cm">#039;name']},\n\n"
f"We received a password reset request for your account.\n\n"
f"Reset your password: {reset_url}\n\n"
f"This link expires in 15 minutes.\n\n"
f"Request details:\n"
f" IP: {request_context[&"cm">#039;ip']}\n"
f" Browser: {request_context[&"cm">#039;browser']}\n"
f" Location: {request_context[&"cm">#039;location']}\n\n"
f"If you didn&"cm">#039;t request this reset, you can safely "
f"ignore this email. Your password will not be changed."
)
response = requests.post(
f"{API}/send",
headers=HEADERS,
json={
"from": "[email protected]",
"to": user["email"],
"subject": "Reset your password (link expires in 15 minutes)",
"text_body": body,
"html_body": build_reset_html(user, reset_url, request_context)
}
)
print(f"Reset email sent in {response.elapsed.total_seconds():.2f}s")Handle a password reset request and send a secure reset email with device context.
import requests
API = "https://api.multimail.dev/v1"
HEADERS = {"Authorization": "Bearer mm_live_xxx"}
def check_reset_abuse(user: dict, request_context: dict) -> bool:
"""Check for suspicious reset patterns."""
recent_resets = get_recent_resets(user["id"], hours=1)
if len(recent_resets) > 3:
"cm"># Multiple reset attempts — send security alert
requests.post(
f"{API}/send",
headers=HEADERS,
json={
"from": "[email protected]",
"to": user["email"],
"subject": "Security alert: Multiple password reset attempts",
"text_body": (
f"Hi {user[&"cm">#039;name']},\n\n"
f"We detected {len(recent_resets)} password reset "
f"attempts on your account in the last hour.\n\n"
f"If this was you, you can use the most recent "
f"reset link. If not, we recommend enabling 2FA."
)
}
)
return True
return FalseFlag unusual reset patterns and send security alerts.
"cm">// Using MultiMail MCP tools for password resets
async function handlePasswordReset(
user: User,
context: RequestContext
) {
const resetUrl = generateResetUrl(user.id);
"cm">// Send reset email immediately
await mcp.send_email({
to: user.email,
subject: "Reset your password (link expires in 15 minutes)",
text_body: [
`Hi ${user.name},`,
``,
`Reset your password: ${resetUrl}`,
`This link expires in 15 minutes.`,
``,
`Request details:`,
` IP: ${context.ip}`,
` Browser: ${context.browser}`,
` Location: ${context.location}`,
``,
`If you didn't request this, ignore this email.`
].join("\n")
});
"cm">// Log the reset event
await mcp.add_contact({
email: user.email,
metadata: {
last_reset_request: new Date().toISOString(),
reset_ip: context.ip
}
});
}Send password reset emails using MultiMail MCP tools.
Autonomous mode sends reset emails the instant the request is received. No queue, no delay, no frustrated users staring at an empty inbox.
Fast, reliable reset emails prevent the cascade of support tickets from users who can't access their accounts. Fewer lockouts means fewer interruptions for your support team.
Every reset email includes IP address, browser, and location so users can identify unauthorized reset attempts at a glance.
Your AI agent can detect unusual reset patterns (multiple attempts from different IPs) and send security alerts proactively.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.