cybernga Posted December 1, 2006 Share Posted December 1, 2006 Hello,I'm trying to get mail() to work as intended (mail is required unfortunately). All code is written in a Linux box with a local Postfix installation that works like a charm ( can send mail through command line ). Environment:PHP Version 4.4.2-1build1Apache 2.0 Ubuntu LinuxThe code is as follows :[code]<?php// The message$message = "Line 1\nLine 2\nLine 3";// In case any of our lines are larger than 70 characters, we should use wordwrap()$message = wordwrap($message, 70);// Sendif(mail('cybernga@localhost','Subject','Message')) { print "Mail sent"; } else { print "Mail not sent";}?>[/code]The above code obviously sends the mail to a local user. The weird part is that when the above code is run through the command line it works just fine, but when it's run from the browser the mail never reaches Postfix (nothing logged)... any ideas ?thank you in advance for any answers :) Link to comment https://forums.phpfreaks.com/topic/29130-mail-behaves-differently-in-cli-and-web-version/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.