Howto change email header in emails send from PHP

Frank R. fandaremail at gmail.com
Fri Sep 24 18:09:30 MSD 2010


The problem is, that nginx is running under nginx user, so the email
address is nginx at mydomain.com, but how can I change it to
no-reply at mydomain.com ?

2010/9/24 bvidinli <bvidinli at gmail.com>:
> those seems to be headers sent by your MTA, such as postfix.
>
> set servername related parameters of postifx accordingly.
>
>
>
> On Fri, Sep 24, 2010 at 12:48 PM, Frank R. <fandaremail at gmail.com> wrote:
>> I am using CakePHP framework, so I set this variables:
>>                $this->Email->from = Configure::read('Site.noreplyemail');
>>                $this->Email->return = Configure::read('Site.noreplyemail');
>>                $this->Email->replyTo=Configure::read('Site.noreplyemail');
>> where Configure::read('Site.noreplyemail') is the email address
>>
>> But this didnt changed all the address in header. The email header is below:
>>
>> Delivered-To: fandaremail at gmail.com
>> Received: by 10.204.121.3 with SMTP id f3cs5634bkr;
>>        Fri, 24 Sep 2010 02:43:02 -0700 (PDT)
>> Received: by 10.100.154.3 with SMTP id b3mr3322700ane.245.1285321381720;
>>        Fri, 24 Sep 2010 02:43:01 -0700 (PDT)
>> Return-Path: <nginx at mydomain>
>> Received: from mydomain (mail.mydomain.com [xxx.xxx.xxx.xxx])
>>        by mx.google.com with ESMTP id d19si4617117and.113.2010.09.24.02.43.01;
>>        Fri, 24 Sep 2010 02:43:01 -0700 (PDT)
>> Received-SPF: neutral (google.com: xxx.xxx.xxx.xxx is neither
>> permitted nor denied by best guess record for domain of
>> nginx at mydomain) client-ip=xxx.xxx.xxx.xxx;
>> Authentication-Results: mx.google.com; spf=neutral (google.com:
>> xxx.xxx.xxx.xxx is neither permitted nor denied by best guess record
>> for domain of nginx at mydomain) smtp.mail=nginx at mydomain
>> Received: from nginx by mydomain with local (Exim 4.63)
>>        (envelope-from <nginx at mydomain>)
>>        id 1Oz4o1-0000Bd-4h
>>        for fandaremail at gmail.com; Fri, 24 Sep 2010 09:43:01 +0000
>> To: fandaremail at gmail.com
>> Subject:  Account Activation
>> From: no-reply at mydomain.com
>> Reply-To: no-reply at mydomain.com
>> X-Mailer: CakePHP Email Component
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 7bit
>> Message-Id: <E1Oz4o1-0000Bd-4h at mydomain>
>> Sender: Nginx user <nginx at mydomain>
>> Date: Fri, 24 Sep 2010 09:43:01 +0000
>>
>>
>> 2010/9/24 bvidinli <bvidinli at gmail.com>:
>>> php code:
>>> mail("toemail at domain.com","subject","messagecontents","From: who at me.com");
>>>
>>> so, headers is a php issue, and can be set in php mail function.
>>> http://php.net/manual/en/function.mail.php
>>>
>>>
>>> Bahattin,
>>> ehcp Developer
>>>
>>> On Fri, Sep 24, 2010 at 12:06 PM, Frank R. <fandaremail at gmail.com> wrote:
>>>> Hello, all emails, which I send from PHP mail() have the header like:
>>>>
>>>> Received: from nginx by localhost with local (Exim 4.63)
>>>>        (envelope-from <nginx at localhost>)
>>>>
>>>> How I can change the address to something like noreply at domain.com there?
>>>>
>>>> Thank You
>>>>
>>>> _______________________________________________
>>>> nginx mailing list
>>>> nginx at nginx.org
>>>> http://nginx.org/mailman/listinfo/nginx
>>>>
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx at nginx.org
>>> http://nginx.org/mailman/listinfo/nginx
>>>
>>
>>
>>
>> --
>> FandaR-IT - Server administration and programming
>> http://fandar-it.com
>> MSN: fandar at seznam.cz
>> ICQ: 217613557
>> GTalk: fandaremail at gmail.com
>> Yahoo: fandar2
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



-- 
FandaR-IT - Server administration and programming
http://fandar-it.com
MSN: fandar at seznam.cz
ICQ: 217613557
GTalk: fandaremail at gmail.com
Yahoo: fandar2



More information about the nginx mailing list