Skip to content

Instantly share code, notes, and snippets.

@westonruter
Last active January 10, 2019 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonruter/a3cd15f242824d47c30744124e44b9cb to your computer and use it in GitHub Desktop.
Save westonruter/a3cd15f242824d47c30744124e44b9cb to your computer and use it in GitHub Desktop.
<!doctype html>
<html amp lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<title>How To Send Emails Via MAMP for Mac OS Localhost - Tech Tutorials</title>
<link rel="canonical" href="https://www.patchworkoftips.com/send-email-mamp-localhost/3902/" />
<script type='text/javascript' src='https://cdn.ampproject.org/v0.js' async></script>
<script type='text/javascript' src='https://cdn.ampproject.org/v0/amp-ad-0.1.js' async custom-element="amp-ad"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic"><style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> <script type="application/ld+json">{"@context":"http:\/\/schema.org","publisher":{"@type":"Organization","name":"Patchwork Of Tips","logo":{"@type":"ImageObject","url":"https:\/\/i2.wp.com\/www.patchworkoftips.com\/blackbee\/wp-content\/uploads\/2016\/12\/cropped-CHEW.png?fit=32%2C32&ssl=1","width":32,"height":32}},"@type":"BlogPosting","mainEntityOfPage":"https:\/\/www.patchworkoftips.com\/send-email-mamp-localhost\/3902\/","headline":"How To Send Emails Via MAMP for Mac OS Localhost","datePublished":"2014-07-23T13:26:11+00:00","dateModified":"2014-07-23T13:26:11+00:00","author":{"@type":"Person","name":"Udegbunam Chukwudi Emmanuel"},"image":{"@type":"ImageObject","url":"https:\/\/i1.wp.com\/www.patchworkoftips.com\/blackbee\/wp-content\/uploads\/2014\/07\/Screen-Shot-2014-07-20-at-9.39.22-PM1.png?fit=720%2C553&ssl=1","width":720,"height":553}}</script>
<meta name="generator" content="AMP Plugin v1.0.1; mode=classic"><meta name="description" content="One advantage of self hosted wordpress over the free blogger platform that&#039;s rarely mentioned is the ability to design and test the functionality of an entire site before uploading it online. To do that we use free softwares like XAMP and WAMP for Windows and MAMP for Mac OS. Testing out certain features of your site that require sending emails doesn&#039;t work offline &#039;cause by default you can&#039;t send emails on localhost via the free version of MAMP but with a little tweak of the php configuration file, that is now possible. For this to work, you must have an email address hosted on a server of your own. CPanel based servers seem to be a lot easier to navigate. To create an email address do please read How To Setup A Self-Hosted Email Address Via CPanel and take note of your SMTP server. Generally for example if your domain is www.thatshot.com, your smtp server and port will be mail.thatshot.com with port 25 Also I tested this on Mac OS X Mavericks 10.9.4 Simple launch MAMP then go Preferences &gt;&gt;&gt; PHP and take note of the PHP version you&#039;re currently running Navigate to Applications\MAMP\conf folder and look for the folder that corresponds to your php version and open the php.ini file contained within with a text editor. Scroll down to the section that says [mail function]. It should look like what appears below Change the parts circled in red below using the appropriate email address and smtp hosted on your server. Save and exit the modified php.ini file and launch Terminal In Terminal, type in or copy and paste this: sudo mkdir -p /Library/Server/Mail/Data/spool and hit enter. Provide your admin&#039;s password when prompted then copy and paste the code in this file into the terminal window and hit enter again. Stop and start MAMP servers again and test the email function again. It should be working just fine now. Hope this works for you as easily as it did for me. Note that there was some delay when sending some emails. Don&#039;t know the reason why though. Enjoy Source 1 et Source 2" />
<meta property="og:title" content="How To Send Emails Via MAMP for Mac OS Localhost - Tech Tutorials" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.patchworkoftips.com/send-email-mamp-localhost/3902/" />
<meta property="og:image" content="https://i1.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.22-PM1.png?fit=720%2C553&#038;ssl=1" />
<meta property="og:image:width" content="512" />
<meta property="og:image:height" content="512" />
<meta property="og:site_name" content="Patchwork Of Tips" />
<meta property="fb:admins" content="704154822" />
<meta property="fb:app_id" content="178004072310914" />
<meta property="og:description" content="One advantage of self hosted wordpress over the free blogger platform that&#039;s rarely mentioned is the ability to design and test the functionality of an entire site before uploading it online. To do that we use free softwares like XAMP and WAMP for Windows and MAMP for Mac OS. Testing out certain features of your site that require sending emails doesn&#039;t work offline &#039;cause by default you can&#039;t send emails on localhost via the free version of MAMP but with a little tweak of the php configuration file, that is now possible. For this to work, you must have an email address hosted on a server of your own. CPanel based servers seem to be a lot easier to navigate. To create an email address do please read How To Setup A Self-Hosted Email Address Via CPanel and take note of your SMTP server. Generally for example if your domain is www.thatshot.com, your smtp server and port will be mail.thatshot.com with port 25 Also I tested this on Mac OS X Mavericks 10.9.4 Simple launch MAMP then go" />
<meta property="article:tag" content="emails" />
<meta property="article:tag" content="localhost" />
<meta property="article:tag" content="mac os x" />
<meta property="article:tag" content="mamp" />
<meta property="article:tag" content="mavericks" />
<meta property="article:tag" content="tech tutorials" />
<meta property="article:publisher" content="https://www.facebook.com/PatchworkOfTips" />
<meta property="article:author" content="https://www.facebook.com/UdegbunamChukwudi" />
<meta property="article:published_time" content="2014-07-23T13:26:11Z" />
<meta property="article:modified_time" content="2014-07-23T13:26:11Z" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@udegbunamchuks" />
<meta name="twitter:creator" content="@udegbunamchuks" />
<meta name="twitter:domain" content="patchworkoftips.com" />
<meta name="twitter:title" content="How To Send Emails Via MAMP for Mac OS Localhost - Tech Tutorials" />
<meta name="twitter:description" content="One advantage of self hosted wordpress over the free blogger platform that&#039;s rarely mentioned is the ability to design and test the functionality of an entire site before uploading it online. To do that we use free softwares like XAMP and WAMP for Windows and MAMP for Mac OS. Testing out certain features of your site that require sending emails doesn&#039;t work offline &#039;cause by default you can&#039;t send emails on localhost via the free version of MAMP but with a little tweak of the php configuration file, that is now possible. For this to work, you must have an email address hosted on a server of your own. CPanel based servers seem to be a lot easier to navigate. To create an email address do please read How To Setup A Self-Hosted Email Address Via CPanel and take note of your SMTP server. Generally for example if your domain is www.thatshot.com, your smtp server and port will be mail.thatshot.com with port 25 Also I tested this on Mac OS X Mavericks 10.9.4 Simple launch MAMP then go" />
<meta name="twitter:image" content="https://i1.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.22-PM1.png?fit=720%2C553&#038;ssl=1" />
<meta itemprop="image" content="https://i1.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.22-PM1.png?fit=720%2C553&#038;ssl=1" />
<style amp-custom>
/* Generic WP styling */
.alignright {
float: right;
}
.alignleft {
float: left;
}
.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.amp-wp-enforced-sizes {
/** Our sizes fallback is 100vw, and we have a padding on the container; the max-width here prevents the element from overflowing. **/
max-width: 100%;
margin: 0 auto;
}
.amp-wp-unknown-size img {
/** Worst case scenario when we can't figure out dimensions for an image. **/
/** Force the image into a box of fixed dimensions and use object-fit to scale. **/
object-fit: contain;
}
/* Template Styles */
.amp-wp-content,
.amp-wp-title-bar div {
margin: 0 auto;
max-width: 600px;
}
html {
background: #1e73be;
}
body {
background: #fff;
color: #353535;
font-family: 'Merriweather', 'Times New Roman', Times, Serif;
font-weight: 300;
line-height: 1.75em;
}
p,
ol,
ul,
figure {
margin: 0 0 1em;
padding: 0;
}
a,
a:visited {
color: #1e73be;
}
a:hover,
a:active,
a:focus {
color: #353535;
}
/* Quotes */
blockquote {
color: #353535;
background: rgba(127,127,127,.125);
border-left: 2px solid #1e73be;
margin: 8px 0 24px 0;
padding: 16px;
}
blockquote p:last-child {
margin-bottom: 0;
}
/* UI Fonts */
.amp-wp-meta,
.amp-wp-header div,
.amp-wp-title,
.wp-caption-text,
.amp-wp-tax-category,
.amp-wp-tax-tag,
.amp-wp-comments-link,
.amp-wp-footer p,
.back-to-top {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
}
/* Header */
.amp-wp-header {
background-color: #1e73be;
}
.amp-wp-header div {
color: #fff;
font-size: 1em;
font-weight: 400;
margin: 0 auto;
max-width: calc(840px - 32px);
padding: .875em 16px;
position: relative;
}
.amp-wp-header a {
color: #fff;
text-decoration: none;
}
/* Site Icon */
.amp-wp-header .amp-wp-site-icon {
/** site icon is 32px **/
background-color: #fff;
border: 1px solid #fff;
border-radius: 50%;
position: absolute;
right: 18px;
top: 10px;
}
/* Article */
.amp-wp-article {
color: #353535;
font-weight: 400;
margin: 1.5em auto;
max-width: 840px;
overflow-wrap: break-word;
word-wrap: break-word;
}
/* Article Header */
.amp-wp-article-header {
align-items: center;
align-content: stretch;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 1.5em 16px 0;
}
.amp-wp-title {
color: #353535;
display: block;
flex: 1 0 100%;
font-weight: 900;
margin: 0 0 .625em;
width: 100%;
}
/* Article Meta */
.amp-wp-meta {
color: #696969;
display: inline-block;
flex: 2 1 50%;
font-size: .875em;
line-height: 1.5em;
margin: 0 0 1.5em;
padding: 0;
}
.amp-wp-article-header .amp-wp-meta:last-of-type {
text-align: right;
}
.amp-wp-article-header .amp-wp-meta:first-of-type {
text-align: left;
}
.amp-wp-byline amp-img,
.amp-wp-byline .amp-wp-author {
display: inline-block;
vertical-align: middle;
}
.amp-wp-byline amp-img {
border: 1px solid #1e73be;
border-radius: 50%;
position: relative;
margin-right: 6px;
}
.amp-wp-posted-on {
text-align: right;
}
/* Featured image */
.amp-wp-article-featured-image {
margin: 0 0 1em;
}
.amp-wp-article-featured-image amp-img {
margin: 0 auto;
}
.amp-wp-article-featured-image.wp-caption .wp-caption-text {
margin: 0 18px;
}
/* Article Content */
.amp-wp-article-content {
margin: 0 16px;
}
.amp-wp-article-content ul,
.amp-wp-article-content ol {
margin-left: 1em;
}
.amp-wp-article-content .wp-caption {
max-width: 100%;
}
.amp-wp-article-content amp-img {
margin: 0 auto;
}
.amp-wp-article-content amp-img.alignright {
margin: 0 0 1em 16px;
}
.amp-wp-article-content amp-img.alignleft {
margin: 0 16px 1em 0;
}
/* Captions */
.wp-caption {
padding: 0;
}
.wp-caption.alignleft {
margin-right: 16px;
}
.wp-caption.alignright {
margin-left: 16px;
}
.wp-caption .wp-caption-text {
border-bottom: 1px solid #c2c2c2;
color: #696969;
font-size: .875em;
line-height: 1.5em;
margin: 0;
padding: .66em 10px .75em;
}
/* AMP Media */
amp-carousel {
background: #c2c2c2;
margin: 0 -16px 1.5em;
}
amp-iframe,
amp-youtube,
amp-instagram,
amp-vine {
background: #c2c2c2;
margin: 0 -16px 1.5em;
}
.amp-wp-article-content amp-carousel amp-img {
border: none;
}
amp-carousel > amp-img > img {
object-fit: contain;
}
.amp-wp-iframe-placeholder {
background: #c2c2c2 url( https://www.patchworkoftips.com/blackbee/wp-content/plugins/amp/assets/images/placeholder-icon.png ) no-repeat center 40%;
background-size: 48px 48px;
min-height: 48px;
}
/* Article Footer Meta */
.amp-wp-article-footer .amp-wp-meta {
display: block;
}
.amp-wp-tax-category,
.amp-wp-tax-tag {
color: #696969;
font-size: .875em;
line-height: 1.5em;
margin: 1.5em 16px;
}
.amp-wp-comments-link {
color: #696969;
font-size: .875em;
line-height: 1.5em;
text-align: center;
margin: 2.25em 0 1.5em;
}
.amp-wp-comments-link a {
border-style: solid;
border-color: #c2c2c2;
border-width: 1px 1px 2px;
border-radius: 4px;
background-color: transparent;
color: #1e73be;
cursor: pointer;
display: block;
font-size: 14px;
font-weight: 600;
line-height: 18px;
margin: 0 auto;
max-width: 200px;
padding: 11px 16px;
text-decoration: none;
width: 50%;
-webkit-transition: background-color 0.2s ease;
transition: background-color 0.2s ease;
}
/* AMP Footer */
.amp-wp-footer {
border-top: 1px solid #c2c2c2;
margin: calc(1.5em - 1px) 0 0;
}
.amp-wp-footer div {
margin: 0 auto;
max-width: calc(840px - 32px);
padding: 1.25em 16px 1.25em;
position: relative;
}
.amp-wp-footer h2 {
font-size: 1em;
line-height: 1.375em;
margin: 0 0 .5em;
}
.amp-wp-footer p {
color: #696969;
font-size: .8em;
line-height: 1.5em;
margin: 0 85px 0 0;
}
.amp-wp-footer a {
text-decoration: none;
}
.back-to-top {
bottom: 1.275em;
font-size: .8em;
font-weight: 600;
line-height: 2em;
position: absolute;
right: 16px;
}
/* Inline stylesheets */
:root:not(#_):not(#_):not(#_):not(#_):not(#_) .amp-wp-1609c8d{height:30px;clear:both}:root:not(#_):not(#_):not(#_):not(#_):not(#_) .amp-wp-a2daeb3{border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px} </style>
</head>
<body class="">
<header id="top" class="amp-wp-header">
<div>
<a href="https://www.patchworkoftips.com/">
<amp-img src="https://i2.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2016/12/cropped-CHEW.png?fit=32%2C32&#038;ssl=1" width="32" height="32" class="amp-wp-site-icon"></amp-img>
<span class="amp-site-title">
Patchwork Of Tips </span>
</a>
</div>
</header>
<article class="amp-wp-article">
<header class="amp-wp-article-header">
<h1 class="amp-wp-title">How To Send Emails Via MAMP for Mac OS Localhost</h1>
<div class="amp-wp-meta amp-wp-byline">
<amp-img src="https://secure.gravatar.com/avatar/193e1263f044dcaa0bdd263f971964f0?s=24&#038;d=mm&#038;r=g" alt="Udegbunam Chukwudi Emmanuel" width="24" height="24" layout="fixed"></amp-img>
<span class="amp-wp-author author vcard">Udegbunam Chukwudi Emmanuel</span>
</div>
<div class="amp-wp-meta amp-wp-posted-on">
<time datetime="2014-07-23T14:26:11+00:00">
4 years ago </time>
</div>
</header>
<figure class="amp-wp-article-featured-image wp-caption">
<amp-img width="720" height="553" src="https://i1.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.22-PM1.png?fit=720%2C553&amp;ssl=1" class="attachment-large size-large wp-post-image amp-wp-enforced-sizes" alt="MAMP for MAC Panel Setup" layout="intrinsic"></amp-img> </figure>
<div class="amp-wp-article-content">
<p>One advantage of self hosted wordpress over the free blogger platform that’s rarely mentioned is the ability to design and test the functionality of an entire site before uploading it online. To do that we use free softwares like XAMP and WAMP for Windows and MAMP for Mac OS.</p>
<p>Testing out certain features of your site that require sending emails doesn’t work offline ‘cause by default you can’t send emails on localhost via the free version of MAMP but with a little tweak of the php configuration file, that is now possible.</p>
<p>For this to work, you must have an email address hosted on a server of your own. CPanel based servers seem to be a lot easier to navigate. To create an email address do please read <a href="https://www.patchworkoftips.com/setup-personal-email-cpanel/148/">How To Setup A Self-Hosted Email Address Via CPanel</a> and take note of your SMTP server. Generally for example if your domain is <strong>www.thatshot.com</strong>, your smtp server and port will be <strong>mail.thatshot.com</strong> with port 25</p>
<p>Also I tested this on Mac OS X Mavericks 10.9.4</p>
<div class="amp-wp-1609c8d"></div>
<amp-ad layout="responsive" width="720" height="200" type="adsense" data-ad-client="ca-pub-4322797130930030" data-ad-slot="7631362617"></amp-ad><div class="amp-wp-1609c8d"></div><p>Simple launch MAMP then go Preferences &gt;&gt;&gt; PHP and take note of the PHP version you’re currently running</p>
<p> </p>
<p><amp-img title="MAMP for MAC Panel Setup" alt="MAMP for MAC Panel Setup" src="https://i2.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.22-PM.png?resize=720%2C553&amp;ssl=1" width="720" height="553" data-recalc-dims="1" class="amp-wp-enforced-sizes amp-wp-a2daeb3" layout="intrinsic"></amp-img></p>
<p><amp-img title="Screen Shot 2014-07-20 at 9.39.35 PM" alt="Screen Shot 2014-07-20 at 9.39.35 PM" src="https://i1.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.39.35-PM.png?resize=720%2C557&amp;ssl=1" width="720" height="557" data-recalc-dims="1" class="amp-wp-enforced-sizes amp-wp-a2daeb3" layout="intrinsic"></amp-img></p>
<p> </p>
<p>Navigate to Applications\MAMP\conf folder and look for the folder that corresponds to your php version and open the php.ini file contained within with a text editor. Scroll down to the section that says [mail function]. It should look like what appears below</p>
<p> </p>
<p><amp-img title="Screen Shot 2014-07-20 at 9.55.46 PM" alt="Screen Shot 2014-07-20 at 9.55.46 PM" src="https://i0.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-9.55.46-PM.png?resize=720%2C201&amp;ssl=1" width="720" height="201" data-recalc-dims="1" class="amp-wp-enforced-sizes amp-wp-a2daeb3" layout="intrinsic"></amp-img></p>
<p> </p>
<p>Change the parts circled in red below using the appropriate email address and smtp hosted on your server.</p>
<div class="amp-wp-1609c8d"></div>
<amp-ad layout="responsive" width="728" height="90" type="adsense" data-ad-client="ca-pub-4322797130930030" data-ad-slot="3400894999"></amp-ad><div class="amp-wp-1609c8d"></div><p> </p>
<p><amp-img title="Screen Shot 2014-07-20 at 10.08.03 PM" alt="Screen Shot 2014-07-20 at 10.08.03 PM" src="https://i0.wp.com/www.patchworkoftips.com/blackbee/wp-content/uploads/2014/07/Screen-Shot-2014-07-20-at-10.08.03-PM.png?resize=720%2C197&amp;ssl=1" width="720" height="197" data-recalc-dims="1" class="amp-wp-enforced-sizes amp-wp-a2daeb3" layout="intrinsic"></amp-img></p>
<p> </p>
<p>Save and exit the modified php.ini file and launch Terminal</p>
<p>In Terminal, type in or copy and paste this: <em>sudo mkdir -p /Library/Server/Mail/Data/spool</em> and hit enter. Provide your admin’s password when prompted then copy and paste the code <a href="https://www.patchworkoftips.com/downloads/mampterminal.txt">in this file</a> into the terminal window and hit enter again.</p>
<p>Stop and start MAMP servers again and test the email function again. It should be working just fine now.</p>
<p>Hope this works for you as easily as it did for me. Note that there was some delay when sending some emails. Don’t know the reason why though.</p>
<p>Enjoy</p>
<p><a href="http://www.blog.tripleroi.com/2012/05/solvedenabling-sendmail-on-localhost.html" rel="nofollow">Source 1</a> et <a href="http://brian.teeman.net/joomla/797-sending-email-with-joomla-and-mamp" rel="nofollow">Source 2</a></p>
</div>
<footer class="amp-wp-article-footer">
<div class="amp-wp-meta amp-wp-tax-category">
Categories: <a href="https://www.patchworkoftips.com/category/tutorials/" rel="category tag">Tech Tutorials</a> </div>
<div class="amp-wp-meta amp-wp-tax-tag">
Tags: <a href="https://www.patchworkoftips.com/tag/emails/" rel="tag">emails</a>, <a href="https://www.patchworkoftips.com/tag/localhost/" rel="tag">localhost</a>, <a href="https://www.patchworkoftips.com/tag/mac-os-x/" rel="tag">mac os x</a>, <a href="https://www.patchworkoftips.com/tag/mamp/" rel="tag">MAMP</a>, <a href="https://www.patchworkoftips.com/tag/mavericks/" rel="tag">mavericks</a> </div>
<div class="amp-wp-meta amp-wp-comments-link">
<a href="https://www.patchworkoftips.com/send-email-mamp-localhost/3902/#comments">
Leave a Comment </a>
</div>
</footer>
</article>
<footer class="amp-wp-footer">
<div>
<h2>Patchwork Of Tips</h2>
<p>
<a href="https://wordpress.org/">
Powered by WordPress </a>
</p>
<a href="#top" class="back-to-top">Back to top</a>
</div>
</footer>
</body>
</html><!-- hyper cache gzip 2019-01-10 07:14:54 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment