MAR model file

I have a demo database and form (using MAR) on a remote server and
upon submission I get a notification email as expected. I have the
same demo setup locally; is there a way to replicate the notification
functionality (for testing purposes) even though MAR can’t access the
remote mail server? This isn’t a problem really, I’m just curious.

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can enable the mailserver built in to your Mac. Actually, it’s on by default, IIRC. Just try the following in a new plain PHP file:

mail('your-email','Hello from PHP',"This is a testnn",'From:your-email','-fyour-email');

Replace your-email above with your actual email address (just the todd(a)wherever.com part) That last argument to the function is not a typo – it really is a hyphen, the letter f, and your e-mail address all smashed together.

If that test doesn’t work, Google for Postfix Enabler. Very quick and easy to use, and it will definitely allow you to send mail from any Mac.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Right now the model file contains the emailing code so do I need to
remove that from the local copy? And does the new file need to be
called from another file or simply placed within the mar app?

On Feb 19, 2009, at 10:06 AM, waltd wrote:

You can enable the mailserver built in to your Mac. Actually, it’s
on by default, IIRC. Just try the following in a new plain PHP file:

mail('your-email','Hello from PHP',"This is a testnn",'From:your- 
email','-fyour-email');

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just make a new test file, call it mail.php, and put that code in it. Put it on your desktop, open up Terminal and do this:

cd Desktop
php mail.php

Watch your in-box to see if anything happened.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Oh, and the code in the model file probably uses the exact same syntax as this test file – this is just the normal way to send mail from PHP. The PHP application server assumes that sendmail will be properly configured (or if you’re on Windows, that the proper SMTP host has been configured in the php.ini file). As long as you are running PHP on your Mac (and I presume MAMP is the same deal) you will just need to have sendmail or postfix set up to send mail, which they normally are and do, out of the box.

If this doesn’t work on the desktop, then try again in the MAMP site folder. Drop the file in there, and navigate to it using whatever address MAMP dictates for you: localhost:8002 or something like that – and tack mail.php on to that URL. See if you get a message when you visit that page locally. You should.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, I tried it on the Desktop with the Terminal. No message. Tried
it in the MAMP site folder. No message. Tried inside the MAR folder
(inside MAMP), no message. PostFix Enabler doesn’t work on Leopard but
MailServe does (same dev) but is $15 though I’m not ready to buy it
just for this one purpose. Is there a way to verify the local mail
server is active using the Terminal?

Thanks,

Todd

On Feb 19, 2009, at 11:27 AM, waltd wrote:

If this doesn’t work on the desktop, then try again in the MAMP site
folder. Drop the file in there, and navigate to it using whatever
address MAMP dictates for you: localhost:8002 or something like that
– and tack mail.php on to that URL. See if you get a message when
you visit that page locally. You should.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

ps auxc | grep postfix

That’s a pipe in the middle, not a lower-case L.

Walter

On Feb 19, 2009, at 6:10 PM, Todd wrote:

Is there a way to verify the local mail server is active using the
Terminal?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

you will just need to have sendmail or postfix set up to send mail

Hmm. (Daydream mode: on) What are the chances that this could be used
to send mail from my Mac, within my university network, without
having to use the brain-dead university mail server?

k


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Very strong chances, as long as your ISP or the University haven’t
blocked the relevant ports in their firewall.

I strongly recommend using an application like Postfix Enabler to
toggle this setting, it’s do-able with the command line, but only
just. Well worth the $19 shareware or so.

Walter

On Feb 25, 2009, at 1:35 PM, Keith Martin wrote:

you will just need to have sendmail or postfix set up to send mail

Hmm. (Daydream mode: on) What are the chances that this could be
used to send mail from my Mac, within my university network, without
having to use the brain-dead university mail server?

k


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options