[SATLUG] postfix question
bruce.dubbs at gmail.com
Wed May 8 17:17:37 CDT 2013
masterr at gmail.com wrote:
> You can specify the from address in PHP itself by using the -f flag in
> the additional parameters in mail(). It should be the 5th parameter.
> From: http://php.net/manual/en/function.mail.php
> bool mail ( string $to , string $subject , string $message [, string
> $additional_headers [, string $additional_parameters ]] )
> The example given:
> mail('nobody at example.com', 'the subject', 'the message', null,
> '-fwebmaster at example.com');
> As long as Postfix allows sending from any address from localhost this
> should work.
Thanks Jon. I did find a workaround in a slightly different way. mailx
supports the doing what I want so I did:
exec ( "echo '$message' | mailx -r $from -s '$subject' $to" );
I suspect the underlying mechanism for both methods is the same.
More information about the SATLUG