Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I asked this over on stackoverflow.

I would love to be able to test php webapps that require emailing registration info etc. on my mac. I downloaded a version of CommuniGate Pro. I need to mail either to an account inside or outside (whichever is best) of the localhost. Again this would be used for testing purposes to verify and debug my code prior to uploading to a hosting service. Any ideas, help and/or examples would be very much appreciated. If it would be easier I could go over to Windows XP. That would just mean setting up wamp and transfering my files over from the mac side via dropbox.

I got the local mailserver to work so I can send emails between accounts. However, I cannot seem to get the php code to work. I know that I am missing something.

<?php
function email($to, $subject, $body, $headers) {
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'From: <noreply@macintosh-3.local>' . "\r\n";
    mail($to, $subject, $body, $headers);
}
?>
share|improve this question
What exactly is your issue? You say you cannot get it to work but do not specify if your getting errors from php side or from the mail server itself? Please give more information – jason Jun 7 '12 at 23:11
1  
It would be preferable to delete your question on Stack Overflow. Cross posting is not encouraged. – slhck Jun 7 '12 at 23:22

closed as off topic by random Jun 8 '12 at 0:59

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.