mail with custom sender on linux
Posted: Wed Oct 11, 2006 8:37 pm
Hello,
At work we have a sales order form that customers fill out online. Upon completion, an email is sent through the PHP mail() function to an RT system that creates a ticket from the email. However, the email is being sent as apache@domain.com, and I need to change it so that the email is being sent from the customer's email address instead. This means that PHP would need to send an email from a different user that is not in our domain almost every time an order form is completed. To do this, I have tried setting the From and Reply-To values in the email headers, but it still isn't working. I was reading that, in fact, those headers only work with PHP on Windows servers. If I were to change the email address in the php.ini file, I'm guessing the sender would change, but then I doubt that changing the php.ini file every time an email is sent out would be a bad idea.
I am a little confused about where the problem is and what exactly I need to do to get the email to be sent from the user's address. Do I need to reconfigure PHP, Apache or Sendmail somehow, or maybe all three? I really need some clear advise on this. Thanks in advance for your help.
David Millet
At work we have a sales order form that customers fill out online. Upon completion, an email is sent through the PHP mail() function to an RT system that creates a ticket from the email. However, the email is being sent as apache@domain.com, and I need to change it so that the email is being sent from the customer's email address instead. This means that PHP would need to send an email from a different user that is not in our domain almost every time an order form is completed. To do this, I have tried setting the From and Reply-To values in the email headers, but it still isn't working. I was reading that, in fact, those headers only work with PHP on Windows servers. If I were to change the email address in the php.ini file, I'm guessing the sender would change, but then I doubt that changing the php.ini file every time an email is sent out would be a bad idea.
I am a little confused about where the problem is and what exactly I need to do to get the email to be sent from the user's address. Do I need to reconfigure PHP, Apache or Sendmail somehow, or maybe all three? I really need some clear advise on this. Thanks in advance for your help.
David Millet