{"_id":"59365227e16643001bac503e","category":{"_id":"59365227e16643001bac5032","version":"59365226e16643001bac5030","project":"543026235eceb608003fde5f","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-06-05T10:03:36.502Z","from_sync":false,"order":1,"slug":"getting-started-from-supportghostorgdevelopers","title":"Self-Host Install & Setup"},"project":"543026235eceb608003fde5f","user":"55acc88c6b4ff90d00784b61","parentDoc":null,"version":{"_id":"59365226e16643001bac5030","project":"543026235eceb608003fde5f","__v":1,"createdAt":"2017-06-06T06:56:38.999Z","releaseDate":"2017-06-06T06:56:38.999Z","categories":["59365227e16643001bac5031","59365227e16643001bac5032","59365227e16643001bac5033","59365227e16643001bac5034"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-05T18:39:19.575Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"The following documentation details how to configure email in Ghost. Ghost uses <a href=\"https://github.com/andris9/Nodemailer\">Nodemailer</a>, their documentation contains even more examples.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"You should be familiar with Ghost's config setup. If not, please read about it [here](https://docs.ghost.org/docs/configuring-ghost#section-custom-configuration-files)!\",\n  \"title\": \"Prerequisites\"\n}\n[/block]\n## Wait what?\n\nMost other other blogging platforms are based on a scripting language called PHP. If you've used those platforms before, you're probably used to having email just magically work. Ghost is based on Node.js. Node is shiny and new, and still a little rough around the edges. It requires some configuration to get email working.\n\nBut don't fear, setting up your email is a one-time thing and we're here to walk you through it.\n\n## But why?\n\nAt the moment, the only thing Ghost uses email for is sending you an email with a new password if you forget yours. It's not much, but don't underestimate how useful that feature is if you ever happen to need it.\n\nIn the future, Ghost will also support setting up email-based subscriptions to your blogs. Emailing new users account details, and other little helpful features that depend on the ability to send mail.\n\n## Ok, so how do I do it?\n\nThe first thing you're going to need is an account with an email sending service. We highly recommend Mailgun. They have a nice free starter account which allows you to send more email than all but the most prolific email-subscription based blogs could manage. You could also use Gmail or Amazon SES.\n\nOnce you've decided on what email service to use, you need to add your settings to [Ghost's config](https://docs.ghost.org/docs/configuring-ghost#section-custom-configuration-files) file, depending on the environment you'd like to set it up for.\n\n## Mailgun\n\nHead along to <a href=\"http://www.mailgun.com/\">mailgun.com</a> and sign up for an account. It's free to use up to 10.000 emails per month. After signing up with Mailgun, verify your email address and <a href=\"https://www.mailgun.com/cp\">log-in to your account</a>. Mailgun allows you to use your own domain for sending transactional emails but if you do not own one it is possible to simply use the handy subdomain that they provide you with (also known as the sandbox domain), although sandbox domains are limited to 300 emails per day. You can change this later, so for now let's use the subdomain automatically generated for you.\n\nNext you're going to need to find your new email service username and password that Mailgun have created for you (they're not the ones you sign up with), by clicking on your sandbox domain on the right hand side. Here is an updated screencast to understand exactly where to find these details:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/415eef1-6uCVuZJ.gif\",\n        \"6uCVuZJ.gif\",\n        1147,\n        590,\n        \"#ebebeb\"\n      ],\n      \"caption\": \"Mailgun\"\n    }\n  ]\n}\n[/block]\nRight, now you've got everything you need, it's time to open up your config file. Depending on the environment you want to setup mail for, open your `config.production.json` or `config.development.json` file in the editor of your choice, and change your mail settings to look like this:\n\n<pre><code>\nmail: {\ntransport: 'SMTP',\n    options: {\n        service: 'Mailgun',\n        auth: {\n            user: '',\n            pass: ''\n        }\n    }\n}\n</code></pre>\n\nPut your 'Login' from mailgun between the quote marks next to 'user' and your 'Password' from mailgun inside the quotes next to 'pass'. If I was configuring mailgun for the 'tryghosttest' account, it would look like this:\n\n<pre><code>\nmail: {\n    transport: 'SMTP',\n    options: {\n        service: 'Mailgun',\n        auth: {\n            user: 'postmaster:::at:::tryghosttest.mailgun.org',\n            pass: '25ip4bzyjwo1'\n        }\n    }\n}\n</code></pre>\n\nKeep an eye out for all of the colons, quotes and curly brackets. Misplace one of those and you'll find you get weird errors.\n\nYou can reuse your settings for both your development and production environment if you have both.\n\nWhen you have finished making changes to you config file don't forget to restart Ghost. \n\n### Amazon SES <a id=\"ses\"></a>\n\nYou can sign up for an Amazon Simple Email Service account over at <http://aws.amazon.com/ses/>. Once you finish signing up, you'll be given an SMTP user name and password.\n\nDepending on the environment you want to setup mail for, open your `config.production.json` or `config.development.json` file in the editor of your choice,  and add your Amazon SMTP credentials to your mail settings as shown below:\n\n```\nmail: {\n    transport: 'SMTP',\n    options: {\n        host: 'YOUR-SES-SERVER-NAME',\n        port: 465,\n        service: 'SES',\n        auth: {\n            user: 'YOUR-SES-ACCESS-KEY-ID',\n            pass: 'YOUR-SES-SECRET-ACCESS-KEY'\n        }\n    }\n}\n```\n\nAnother way to configure mail is using your AWS access keys, like this:\n\n```\nmail: {\n    transport: 'SES',\n    options: {\n        AWSAccessKeyID: \"AWSACCESSKEY\",\n        AWSSecretKey: \"/AWS/SECRET\"\n    }\n}\n```\n\nThe <a href=\"https://gist.github.com/neilstuartcraig/7025554\">first option</a> is safer as stated on <a href=\"http://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html\">AWS Reference guide</a>\n\nWhen you have finished making changes to chosen config file don't forget to restart Ghost. \n\n## From Address\n\nBy default the 'from' address for mail sent from Ghost will be set to `Blog Title <ghost@your-ghost-blog.com>` - where `Blog Title` is the title you have set in settings, and `your-ghost-blog.com` is the URL set in your custom config file. If you want to override this to something different, you can also configure it in the config file.\n\nIf you only want to override the email address, you can do so with:\n\n```\nmail: {\n    from: 'myemail@address.com',\n}\n```\n\nAlternatively you can also provide a custom name:\n\n```\nmail: {\n    from: '\"Custom Name\" <myemail@address.com>',\n}\n```\nWhen you have finished making changes to your custom config file don't forget to restart Ghost.","excerpt":"","slug":"mail-config","type":"basic","title":"Mail Configuration"}

Mail Configuration


The following documentation details how to configure email in Ghost. Ghost uses <a href="https://github.com/andris9/Nodemailer">Nodemailer</a>, their documentation contains even more examples. [block:callout] { "type": "info", "body": "You should be familiar with Ghost's config setup. If not, please read about it [here](https://docs.ghost.org/docs/configuring-ghost#section-custom-configuration-files)!", "title": "Prerequisites" } [/block] ## Wait what? Most other other blogging platforms are based on a scripting language called PHP. If you've used those platforms before, you're probably used to having email just magically work. Ghost is based on Node.js. Node is shiny and new, and still a little rough around the edges. It requires some configuration to get email working. But don't fear, setting up your email is a one-time thing and we're here to walk you through it. ## But why? At the moment, the only thing Ghost uses email for is sending you an email with a new password if you forget yours. It's not much, but don't underestimate how useful that feature is if you ever happen to need it. In the future, Ghost will also support setting up email-based subscriptions to your blogs. Emailing new users account details, and other little helpful features that depend on the ability to send mail. ## Ok, so how do I do it? The first thing you're going to need is an account with an email sending service. We highly recommend Mailgun. They have a nice free starter account which allows you to send more email than all but the most prolific email-subscription based blogs could manage. You could also use Gmail or Amazon SES. Once you've decided on what email service to use, you need to add your settings to [Ghost's config](https://docs.ghost.org/docs/configuring-ghost#section-custom-configuration-files) file, depending on the environment you'd like to set it up for. ## Mailgun Head along to <a href="http://www.mailgun.com/">mailgun.com</a> and sign up for an account. It's free to use up to 10.000 emails per month. After signing up with Mailgun, verify your email address and <a href="https://www.mailgun.com/cp">log-in to your account</a>. Mailgun allows you to use your own domain for sending transactional emails but if you do not own one it is possible to simply use the handy subdomain that they provide you with (also known as the sandbox domain), although sandbox domains are limited to 300 emails per day. You can change this later, so for now let's use the subdomain automatically generated for you. Next you're going to need to find your new email service username and password that Mailgun have created for you (they're not the ones you sign up with), by clicking on your sandbox domain on the right hand side. Here is an updated screencast to understand exactly where to find these details: [block:image] { "images": [ { "image": [ "https://files.readme.io/415eef1-6uCVuZJ.gif", "6uCVuZJ.gif", 1147, 590, "#ebebeb" ], "caption": "Mailgun" } ] } [/block] Right, now you've got everything you need, it's time to open up your config file. Depending on the environment you want to setup mail for, open your `config.production.json` or `config.development.json` file in the editor of your choice, and change your mail settings to look like this: <pre><code> mail: { transport: 'SMTP', options: { service: 'Mailgun', auth: { user: '', pass: '' } } } </code></pre> Put your 'Login' from mailgun between the quote marks next to 'user' and your 'Password' from mailgun inside the quotes next to 'pass'. If I was configuring mailgun for the 'tryghosttest' account, it would look like this: <pre><code> mail: { transport: 'SMTP', options: { service: 'Mailgun', auth: { user: 'postmaster@tryghosttest.mailgun.org', pass: '25ip4bzyjwo1' } } } </code></pre> Keep an eye out for all of the colons, quotes and curly brackets. Misplace one of those and you'll find you get weird errors. You can reuse your settings for both your development and production environment if you have both. When you have finished making changes to you config file don't forget to restart Ghost. ### Amazon SES <a id="ses"></a> You can sign up for an Amazon Simple Email Service account over at <http://aws.amazon.com/ses/>. Once you finish signing up, you'll be given an SMTP user name and password. Depending on the environment you want to setup mail for, open your `config.production.json` or `config.development.json` file in the editor of your choice, and add your Amazon SMTP credentials to your mail settings as shown below: ``` mail: { transport: 'SMTP', options: { host: 'YOUR-SES-SERVER-NAME', port: 465, service: 'SES', auth: { user: 'YOUR-SES-ACCESS-KEY-ID', pass: 'YOUR-SES-SECRET-ACCESS-KEY' } } } ``` Another way to configure mail is using your AWS access keys, like this: ``` mail: { transport: 'SES', options: { AWSAccessKeyID: "AWSACCESSKEY", AWSSecretKey: "/AWS/SECRET" } } ``` The <a href="https://gist.github.com/neilstuartcraig/7025554">first option</a> is safer as stated on <a href="http://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html">AWS Reference guide</a> When you have finished making changes to chosen config file don't forget to restart Ghost. ## From Address By default the 'from' address for mail sent from Ghost will be set to `Blog Title <ghost@your-ghost-blog.com>` - where `Blog Title` is the title you have set in settings, and `your-ghost-blog.com` is the URL set in your custom config file. If you want to override this to something different, you can also configure it in the config file. If you only want to override the email address, you can do so with: ``` mail: { from: 'myemail@address.com', } ``` Alternatively you can also provide a custom name: ``` mail: { from: '"Custom Name" <myemail@address.com>', } ``` When you have finished making changes to your custom config file don't forget to restart Ghost.