私は小さなPHPスクリプトを書きました:
<?php
$phpPath = shell_exec("which php");
print "$phpPath\n";
$uid = posix_getuid();
$userinfo = posix_getpwuid($uid);
print_r($userinfo );
print "\n";
$to = "my_user_name@my_company_mail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "do-not-reply@akamai.com";
$headers = "From:" . $from;
$res = mail($to,$subject,$message,$headers);
print_r(error_get_last());
if($res){
echo "Mail Sent.\n";
}else{
echo "Mail was'nt Sent\n";
}
?>
私を夢中にさせているのは、コマンドラインからこのスクリプトを実行すると正常に動作することです: /usr/bin/php
配列 ( [名前] => デーモン [passwd] => x [uid] => 1 [gid] => 1 [gecos] => デーモン [dir] => /usr/sbin [シェル] => /bin/sh )
メールが送信されました。
しかし、リモートブラウザから実行すると、次のようになります:
/usr/bin/php
配列 ( [名前] => デーモン [passwd] => x [uid] => 1 [gid] => 1 [gecos] => デーモン [dir] => /usr/sbin [シェル] => /bin/sh )
メールが送信されませんでした
何か案が?10倍前に:)