|
Posted by rchen8080 on 04/04/07 02:21
I found that the php script behaves differently when it run in command
line rather than runing over web server.
Program includes the code like
<?php
function send_email($from_address, $to_address, $bcc_address,
$subject, $msg, $attachments,$reminder_id) {
$headers = ...;
....
mail($to_address, $subject, $msg, $headers);
...
}
#main body of code here to grap info from database and call
send_mail() function here
...
send_email($newarry[FROM_ADDRESS], $newarry[TO_ADDRESS], $newarry
[BCC_ADDRESS], $newarry[SUBJECT], $newarry[BODY],$attachments,
$newarry[ID]);
?>
I can not use lynx since it doesn't support https on my machine.
The values are from database and feed in send_mail() function which
will form the body message and header and pass to php mail()
function. The problem is that "mail($to_address, $subject, $msg,
$headers)" can not access the values passed over to it when i use
'php' command to run the script. But I can use 'print' to print out
all the values but mail()function just can't get them.
However, this program works fine when I use broswer to access it.
Any help will be greatly appreciated.
Runner
[Back to original message]
|