<p>In Craft 3, you can use <a href="https://docs.craftcms.com/v3/config/app.html" rel="nofollow noreferrer">app.php</a> file to connect to an external SMTP server. </p>

<p>Article on my blog craftSnippets describes how to do this. It deals with Mailtrap, fake SMTP server, but you can connect to any server that way.</p>

<p><a href="http://craftsnippets.com/articles/testing-and-debugging-emails-sent-by-craft-cms-using-mailtrap" rel="nofollow noreferrer">http://craftsnippets.com/articles/testing-and-debugging-emails-sent-by-craft-cms-using-mailtrap</a></p>

CC BY-SA 4.0
2019-03-29T00:14:18.040Z
2019-03-29T00:14:18.040Z
Piotr Pogorzelski
<p>If you are just testing email under MAMP try using ToolHeap Mail tool: Test Mail Server Tool. It will save you a lot of headaches. George Campbell</p>

CC BY-SA 4.0
2020-07-25T17:47:49.847Z
2020-07-25T17:47:49.847Z
George A Campbell
<p>It's 2018, and as <a href="https://craftcms.stackexchange.com/questions/2028/how-do-i-set-up-craft-to-send-emails-from-my-local-mamp-virtual-host-x-dev-envir#comment29567_2031">Masiorama</a> mentioned, MandrillApp is no longer available for free. As a Windows user, the general "Get PHP Mail to work on localhost" solution detailed <a href="https://stackoverflow.com/a/33333766/999556">here</a> worked for me.</p>

<p>Note: It requires a Gmail address, and that you paste your Gmail password into the <code>php.ini</code> file of your localhost server. Basically, you need to configure <code>sendmail</code> on localhost to use your Gmail account's SMTP service.</p>

CC BY-SA 3.0
2018-03-19T22:29:59.213Z
2018-03-19T22:29:59.213Z
Sandwich
<p>These days I just use <a href="https://mandrillapp.com">Mandrill</a>.</p>

<p>It's simple to set up, free unless you're sending tens of thousands of emails, and you can continue to use it on any development (or production) machine without any configuration changes.</p>

<p>Just set <a href="http://help.mandrill.com/categories/20090941-SMTP-Integration">the Mandrill SMTP settings</a> in the Craft admin area, and you're done.</p>

CC BY-SA 3.0
2015-06-19T14:09:56.083Z
What does the "From" field look like in the mail client? Can you customize this stuff to get something like From: Company Name <no-reply@company-name.com> ?
jlcharette
CC BY-SA 3.0
2015-06-21T21:49:26.517Z
@JCharette It depends how you're sending emails (via a plugin, via the contact form, etc). I believe the sender name and email address are controlled by the email settings page (Settings / Email) in the Control Panel, so that's a good place to start.
Stephen Lewis
CC BY-SA 3.0
2015-02-02T17:12:12.503Z
@StevenGrant Doesn't look like it from [the docs](http://buildwithcraft.com/docs/config-settings). There's nothing in the code to suggest you can, either.
Stephen Lewis
CC BY-SA 3.0
2017-07-27T20:18:18.350Z
"On April 27, Mandrill became a paid MailChimp add-on. Any Mandrill accounts that weren't linked to a MailChimp account by May 11, 2016 have been disabled and can no longer be accessed." via https://mandrillapp.com/
Masiorama
CC BY-SA 3.0
2014-08-19T21:44:34.827Z
Thanks much Stephen. I've never used or heard of Mandrill before, but got it up and working in about 2 minutes. Great recommendation!
Adam Snetman
CC BY-SA 3.0
2014-08-19T21:46:15.543Z
Glad I could help, Adam.
Stephen Lewis
CC BY-SA 3.0
2014-12-13T09:32:54.337Z
is it possible to add those details to config rather than setting them in admin?
Steven Grant
CC BY-SA 3.0
2014-08-19T21:16:37.830Z
2014-08-19T21:16:37.830Z
Stephen Lewis
<p>I'm developing a site locally using MAMP + VirtualHostX on Mavericks. I'm at the point in the project where I want to create some user accounts for clients, but I can't seem to get my mail set up properly so Craft can send emails from my local environment.</p>

<p>Has anyone done this same thing? Any advice for getting Craft emails working on a similar local dev environment?</p>

<p>Thanks!</p>

CC BY-SA 3.0
2014-08-19T21:11:32.423Z
Hmm.. there was a user with [similar problems](http://craftcms.stackexchange.com/questions/1508/craft-smtp-emails-localhost-mamp-pro-postmarkapp) some days ago.
carlcs
CC BY-SA 3.0
2014-08-19T21:12:52.267Z
I had the same issue I was unable to resolve. Craft will send emails (same MAMP setup) on one computer but not the other.
Adam McCombs
CC BY-SA 3.0
2014-08-20T00:47:12.790Z
@AdamMcCombs The Mandrill suggestion below from Stephen Lewis worked like a charm for me. You just have to change the email protocol setting in Craft to use SMTP and use the settings Mandrill provides once your account is set up.
Adam Snetman
<emails><mamp>
How do I set up Craft to send emails from my local MAMP/Virtual Host X dev environment
# How do I set up Craft to send emails from my local MAMP/Virtual Host X dev environment

(Asked by: username_0 on 2014-08-19)

I'm developing a site locally using MAMP + VirtualHostX on Mavericks. I'm at the point in the project where I want to create some user accounts for clients, but I can't seem to get my mail set up properly so Craft can send emails from my local environment.

Has anyone done this same thing? Any advice for getting Craft emails working on a similar local dev environment?

Thanks!

**Tags:** emails, mamp

> **Comments:**
> **username_1**: Hmm.. there was a user with [similar problems](http://craftcms.stackexchange.com/questions/1508/craft-smtp-emails-localhost-mamp-pro-postmarkapp) some days ago.  
> **username_2**: I had the same issue I was unable to resolve. Craft will send emails (same MAMP setup) on one computer but not the other.  
> **username_0**: @AdamMcCombs The Mandrill suggestion below from username_6 worked like a charm for me. You just have to change the email protocol setting in Craft to use SMTP and use the settings Mandrill provides once your account is set up.  

---

## 4 answers

### Answer by username_6 on 2014-08-19. Score: 14 | Accepted answer

These days I just use [Mandrill](https://mandrillapp.com).

It's simple to set up, free unless you're sending tens of thousands of emails, and you can continue to use it on any development (or production) machine without any configuration changes.

Just set [the Mandrill SMTP settings](http://help.mandrill.com/categories/20090941-SMTP-Integration) in the Craft admin area, and you're done.

> **Comments:**
> **username_0**: Thanks much Stephen. I've never used or heard of Mandrill before, but got it up and working in about 2 minutes. Great recommendation!  
> **username_6**: Glad I could help, Adam.  
> **username_9**: is it possible to add those details to config rather than setting them in admin?  
> **username_6**: @StevenGrant Doesn't look like it from [the docs](http://buildwithcraft.com/docs/config-settings). There's nothing in the code to suggest you can, either.  
> **username_7**: What does the "From" field look like in the mail client? Can you customize this stuff to get something like From: Company Name <no-reply@company-name.com> ?  
> **username_6**: @JCharette It depends how you're sending emails (via a plugin, via the contact form, etc). I believe the sender name and email address are controlled by the email settings page (Settings / Email) in the Control Panel, so that's a good place to start.  
> **username_8**: "On April 27, Mandrill became a paid MailChimp add-on. Any Mandrill accounts that weren't linked to a MailChimp account by May 11, 2016 have been disabled and can no longer be accessed." via https://mandrillapp.com/  

---

### Answer by username_3 on 2019-03-29. Score: 1

In Craft 3, you can use [app.php](https://docs.craftcms.com/v3/config/app.html) file to connect to an external SMTP server.

Article on my blog craftSnippets describes how to do this. It deals with Mailtrap, fake SMTP server, but you can connect to any server that way.

<http://craftsnippets.com/articles/testing-and-debugging-emails-sent-by-craft-cms-using-mailtrap>


---

### Answer by username_4 on 2020-07-25. Score: 1

If you are just testing email under MAMP try using ToolHeap Mail tool: Test Mail Server Tool. It will save you a lot of headaches. George Campbell


---

### Answer by username_5 on 2018-03-19. Score: 1

It's 2018, and as [username_8](https://craftcms.stackexchange.com/questions/2028/how-do-i-set-up-craft-to-send-emails-from-my-local-mamp-virtual-host-x-dev-envir#comment29567_2031) mentioned, MandrillApp is no longer available for free. As a Windows user, the general "Get PHP Mail to work on localhost" solution detailed [here](https://stackoverflow.com/a/33333766/999556) worked for me.

Note: It requires a Gmail address, and that you paste your Gmail password into the `php.ini` file of your localhost server. Basically, you need to configure `sendmail` on localhost to use your Gmail account's SMTP service.


---

