{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/smtp-relay/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Standard Configuration","siteUrl":"https://dev.mailjet.com/","projectTitle":"Mailjet Developer Documentation","description":"Set up Mailjet’s SMTP relay: hostname in-v3.mailjet.com, ports 25, 80, 465, 587, 588, and 2525, plus Postfix sender-dependent routing with SASL credentials.","image":"https://dev.mailjet.com/og-image.png","lang":"en-US","keywords":["Mailjet API","Email API","Content API","SMTP Relay","transactional email","email delivery","Send API","email templates","developer documentation"],"meta":[{"name":"og:type","content":"website"},{"name":"og:site_name","content":"Mailjet Developer Documentation"},{"name":"twitter:card","content":"summary_large_image"},{"name":"robots","content":"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"},{"name":"googlebot","content":"index, follow, max-snippet:-1, max-image-preview:large"}],"jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://dev.mailjet.com/#organization","name":"Mailjet","alternateName":"Sinch Mailjet","url":"https://www.mailjet.com","logo":"https://assets.mailjet.com/lib/images/mailjetLogo/mj_logo_with_text_color.png","parentOrganization":{"@type":"Organization","name":"Sinch","url":"https://www.sinch.com"}},{"@type":"WebSite","@id":"https://dev.mailjet.com/#website","name":"Mailjet Developer Documentation","description":"Official developer documentation for the Mailjet Email API, Content API and SMTP Relay.","url":"https://dev.mailjet.com/","inLanguage":"en-US","publisher":{"@id":"https://dev.mailjet.com/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://dev.mailjet.com/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]},"llmstxt":{"hide":false,"title":"Mailjet Developer Documentation","description":"Developer documentation for the Mailjet Email API, Content API and SMTP Relay - guides, API references and code samples for sending, templating and tracking email at scale.","details":{"content":"Mailjet (part of Sinch) provides APIs for sending and managing email.\n\nThis documentation covers four main areas:\n\n- **Email API** - the Send API (v3 and v3.1) for transactional and marketing email,\n  plus contact management, segmentation, campaigns, statistics, webhooks, the Parse API\n  and the Mailjet Templating Language.\n- **Content API** - programmatic management of email templates, template contents,\n  images, labels and authentication tokens (v1).\n- **SMTP Relay** - sending through Mailjet's SMTP servers, including custom headers.\n- **API Reference** - the complete, generated reference for every endpoint, built directly\n  from the OpenAPI specifications.\n\nBase URL for all REST APIs: `https://api.mailjet.com`.\nAuthentication uses HTTP Basic auth with an API key and secret key.\n\n## Machine-readable entry points\n\nPrefer these when you need the API surface in as few requests as possible:\n\n- `/openapi/openapi-mailjet.md` - the **complete** Email API reference (every endpoint,\n  grouped by resource) as a single Markdown document.\n- `/openapi/openapi-passport.md` - the **complete** Content API reference as a single\n  Markdown document.\n- `/_bundle/openapi/openapi-mailjet.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Email API.\n- `/_bundle/openapi/openapi-passport.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Content API.\n- `/sitemap.xml` - every indexable URL on this site.\n\nEvery page on this site is also available as clean Markdown by appending `.md` to its URL."},"sections":[{"title":"Email API","description":"Sending, contacts, campaigns, statistics, webhooks and templating.","includeFiles":["docs/email-api/**/*.md"],"excludeFiles":[]},{"title":"Content API","description":"Manage templates, template contents, images, labels and tokens.","includeFiles":["docs/content-api/**/*.md","docs/content-api.md"],"excludeFiles":[]},{"title":"SMTP Relay","description":"Send email through Mailjet's SMTP servers.","includeFiles":["docs/smtp-relay/**/*.md"],"excludeFiles":[]},{"title":"API Reference","description":"Complete generated reference for every Mailjet API endpoint.","includeFiles":["openapi/openapi-mailjet.yaml","openapi/openapi-passport.yaml","docs/api-reference/**/*.md"],"excludeFiles":[]},{"title":"Migrating from Mandrill","description":"Guides for switching from Mandrill to Mailjet.","includeFiles":["docs/mandrill/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"standard-configuration","__idx":0},"children":["Standard Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To route your emails through Mailjet's SMTP server you will only have to modify your SMTP settings using our hostname, port and your SMTP credentials."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"smtp-hostname","__idx":1},"children":["SMTP hostname"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mailjet’s host name is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["in-v3.mailjet.com"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"smtp-ports","__idx":2},"children":["SMTP Ports"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here’s the list of ports that Mailjet is supporting:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Port"},"children":["Port"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"TLS"},"children":["TLS"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"SSL"},"children":["SSL"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["25"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["80"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["465"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["587/588"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["2525"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read our ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.mailjet.com/blog/news/which-smtp-port-mailjet/"},"children":["blogpost"]}," for details on the supported SMTP ports."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"smtp-credentials","__idx":3},"children":["SMTP Credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Access your Mailjet account and go to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://app.mailjet.com/account/relay"},"children":["SMTP section"]}," to find your SMTP credentials."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"postfix-installation","__idx":4},"children":["Postfix Installation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can configure your Postfix to send via in.mailjet.com relay, depending on the sender, by following these steps:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this example, all outgoing emails are sent directly to Mail eXchangers (MX), except when From is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*@example.com"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["example@example.net"]},", which are going through Mailjet."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Caution: for Postfix, a sender is not the From: but the sender envelope passed to sendmail (in the 5th mail() argument: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-fexample@example.com"]}," or in PHP config php.ini : ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sendmail_path = /path/to/sendmail -t -i -fexample@example.com)"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In /etc/postfix/main.cf (remove relayhost)."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"smtp_sender_dependent_authentication = yes\nsender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay\nsmtp_sasl_auth_enable = yes\nsmtp_sasl_security_options = noanonymous\nsmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In /etc/postfix/sender_relay, list addresses that must go through a relay."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"@example.com in.mailjet.com\nexample@example.net in.mailjet.com\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In /etc/postfix/saslpasswd, provide credentials for each address listed in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/etc/postfix/senderrelay"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"@example.com apikey:secretkey\nexample@example.net apikey2:secretkey2\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Don't forget the following commands."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"cd /etc/postfix\nchmod 600 sasl_passwd\nchown root:root sasl_passwd\npostmap sasl_passwd sender_relay\npostfix reload\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"other-configurations","__idx":5},"children":["Other Configurations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Desktop email clients (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/support/how-do-i-change-my-smtp-settings-in-outlook,98.htm"},"children":["Outlook"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/apple-mail-smtp-setup"},"children":["Apple Mail"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/thunderbird-smtp-setup"},"children":["Thunderbird"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["MTA & MDA (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/exim"},"children":["exim"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Frameworks and Languages (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/php"},"children":["Php"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/java"},"children":["Java"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/asp"},"children":["Asp.net"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/php/zend"},"children":["Zend"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/docs/code/php/codeigniter"},"children":["CodeIgniter"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Webmail (",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://uk.mailjet.com/support/how-to-set-up-mailjet-s-smtp-with-gmail,110.htm"},"children":["Gmail and Google Apps"]},")"]}]}]},"headings":[{"value":"Standard Configuration","id":"standard-configuration","depth":1},{"value":"SMTP hostname","id":"smtp-hostname","depth":2},{"value":"SMTP Ports","id":"smtp-ports","depth":2},{"value":"SMTP Credentials","id":"smtp-credentials","depth":3},{"value":"Postfix Installation","id":"postfix-installation","depth":2},{"value":"Other Configurations","id":"other-configurations","depth":3}],"frontmatter":{"title":"Mailjet SMTP Relay","seo":{"description":"Set up Mailjet’s SMTP relay: hostname in-v3.mailjet.com, ports 25, 80, 465, 587, 588, and 2525, plus Postfix sender-dependent routing with SASL credentials.","title":"Standard Configuration"}},"lastModified":"2026-08-26T10:53:57.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/smtp-relay/configuration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}