mail with custom sender on linux

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spiderworm
Forum Newbie
Posts: 2
Joined: Wed Oct 11, 2006 8:25 pm

mail with custom sender on linux

Post 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
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post 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.
spiderworm
Forum Newbie
Posts: 2
Joined: Wed Oct 11, 2006 8:25 pm

Post by spiderworm »

Will this swiftmailer app allow me to set the email sender to whatever address I would like?

Thanks,
David
Post Reply