[SATLUG] postfix question

Bruce Dubbs bruce.dubbs at gmail.com
Wed May 8 17:17:37 CDT 2013


masterr at gmail.com wrote:
> Bruce,
>
> 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:
>
> <?php
> 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.

   -- Bruce


More information about the SATLUG mailing list