3

Currently I have a mail server configured (a real one from my ISP) and mail internal and external works on the command line. In PHP only external users work.

For testing I would like to send to internal users only.

( Ideally I would like to set up lots of aliases that point to one user so mail to: [email protected], [email protected], [email protected] end up in /var/mail/johnsmith )

I'd be greatful if someone could help here. I'm hesitant to edit the postfix config files...

On the command line johnsmith@localhost works but not in PHP. It's using cakePHP and I checked the value of $email-addr just before the send ($this->Email->send();) and the value is johnsmith@localhost. I'm not that familiar with cakePHP yet. The var/log/mail shows nothing, only external email addresses.

(server is Suse linux)

0

2 Answers 2

3

You can use the basic mail php function

http://php.net/manual/en/function.mail.php

Under linux, mail php function relies on sendmail, just check that sendmail is properly installed.

1

In /etc/postfix/main.cf add localhost.com:

mydestination = $myhostname, localhost.$mydomain,localhost,localhost.com

This allows sending on "[email protected]" via command line. I loaded up a test php mail form script in a browser and it works, sending mail through to /var/mail/localuser.

At the moment it means I have to check each local users /var/mail file. I'm working on the alias. My first attempt at that failed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.