Page 1 of 1

mail with custom sender on linux

Posted: Wed Oct 11, 2006 8:37 pm
by spiderworm
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

Posted: Wed Oct 11, 2006 11:22 pm
by akimm
mail() is NOT safe. higher traffic is analogous with more danger, the more traffic that uses this program the more chances you have of compromising your form, while you're still in developmenti suggest swiftmailer.

Posted: Thu Oct 12, 2006 2:02 am
by spiderworm
Will this swiftmailer app allow me to set the email sender to whatever address I would like?

Thanks,
David