macKeet Posted March 16, 2007 Share Posted March 16, 2007 Hi all, getting email sent to me trough PHP but the "from" email heading is not what I want, how do I change that Kind Regards Link to comment https://forums.phpfreaks.com/topic/42930-email-with-php/ Share on other sites More sharing options...
Trium918 Posted March 16, 2007 Share Posted March 16, 2007 It would be helpful if we could see the code! Link to comment https://forums.phpfreaks.com/topic/42930-email-with-php/#findComment-208511 Share on other sites More sharing options...
macKeet Posted March 16, 2007 Author Share Posted March 16, 2007 I guess it would help <?php $to = "[email protected]"; $date = date('l dS \of F Y h:i:s A'); $msg = "Order from your site\nName: ".$_POST['name']."\nTelephone: ".$_POST['tel']."\nEmail: ".$_POST['email']."\nDetails: ".$_POST['details']."\nDate: $date"; mail($to, "Order", $msg); echo "code=ok"; ?> Regards Link to comment https://forums.phpfreaks.com/topic/42930-email-with-php/#findComment-208512 Share on other sites More sharing options...
peeps Posted March 16, 2007 Share Posted March 16, 2007 There is an optional fourth parameter which does stuff with headers. If you want to specify who the email is from try this $header = 'From: [email protected]' . "\r\n"; mail($to, "Order", $msg, $header); Hope that helps. Link to comment https://forums.phpfreaks.com/topic/42930-email-with-php/#findComment-208520 Share on other sites More sharing options...
macKeet Posted March 16, 2007 Author Share Posted March 16, 2007 u-beaut ....works great many thanks Link to comment https://forums.phpfreaks.com/topic/42930-email-with-php/#findComment-208523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.