huntersj78 Posted November 15, 2011 Share Posted November 15, 2011 I have searched up and down the internet for a fix and tried just about everything. But before I cry my heart out here please take a second to some history to this problem. I am the newest of newbs when it comes to this stuff. I am a musician who kinda got the job of picking up the crap code (so I have been told) left by the old programmer and for some reason instead of hiring a programmer everyone was like lets let Steven do it. He is a drummer so he must be a programmer Anyway. The way the site used to work was a customer would get a username and password to access the file upload service. They would upload their data for us and send us a message (if they wanted to send a message). Now from the main site after the upload the file the customer chose to send would not be saved on our main site, but on a in house server (reason being it was easier for us to access files on our network than download them from the net) and then the in house server would send a mail to us (to the main domain) saying there was a file available. Well one day we transferred the server to a new host (host gator) and it was there I was getting this error: Warning: mb_send_mail() [function.mb-send-mail]: Failed to connect to mailserver at "smtp.discoveryfirm.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\download\receive.php on line 241 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\download\receive.php:241) in C:\xampp\htdocs\download\receive.php on line 244 The current host said it was something they could not fix so I looked on the net of knowledge for an answer. I found so many with the same error and tried everything in the book. First I changed smtp.discoveryfirm.com to mail.discoveryfirm.com because that is what the new host uses. I then changed the php.ini and also the sendmail.ini which got rid of the error above but then gave me this error: SMTP server response: 550 Access denied - Invalid HELO name Now before I break anything else I want to know if there is some PHP master in here that guide me to the light. Really sorry if I am unclear and if I can be more clear please just let me know what you need to see and I will hunt it down and tell you. Here is the php code in the file mentioned above, but I dont know if it is what you need. <?php set_time_limit(300); $TotalFileSize = ($_FILES[file1][size] + $_FILES[file2][size] + $_FILES[file3][size] + $_FILES[file4][size] + $_FILES[file5][size] + $_FILES[file6][size] + $_FILES[file7][size] + $_FILES[file8][size] + $_FILES[file9][size] + $_FILES[file10][size]); /* if($TotalFileSize > 200000000) { header('Location:https://www.discoveryfirm.com/upload/upload.php?error=1'); return; } */ //ファイル名配列化 $FileName = array($_FILES[file1][name], $_FILES[file2][name], $_FILES[file3][name], $_FILES[file4][name], $_FILES[file5][name], $_FILES[file6][name], $_FILES[file7][name], $_FILES[file8][name], $_FILES[file9][name], $_FILES[file10][name]); $FileTmpPath = array($_FILES[file1][tmp_name], $_FILES[file2][tmp_name], $_FILES[file3][tmp_name], $_FILES[file4][tmp_name], $_FILES[file5][tmp_name], $_FILES[file6][tmp_name], $_FILES[file7][tmp_name], $_FILES[file8][tmp_name], $_FILES[file9][tmp_name],$_FILES[file10][tmp_name]); $FileSize = array($_FILES[file1][size], $_FILES[file2][size], $_FILES[file3][size], $_FILES[file4][size], $_FILES[file5][size], $_FILES[file6][size], $_FILES[file7][size], $_FILES[file8][size], $_FILES[file9][size], $_FILES[file10][size]); //フォルダネーム取得 $Folder = $_POST[folder]; switch($Folder) { case "ogasawara": $ftp_user = "staff"; $ftp_pass = ""; break; case "yamaguchi": $ftp_user = "staff"; $ftp_pass = ""; break; case "mami": $ftp_user = "staff"; $ftp_pass = ""; break; case "kawaura": $ftp_user = "staff"; $ftp_pass = ""; break; case "souma": $ftp_user = "staff"; $ftp_pass = ""; break; case "chiba": $ftp_user = "staff"; $ftp_pass = ""; break; case "akiya": $ftp_user = "staff"; $ftp_pass = ""; break; case "kishimoto": $ftp_user = "staff"; $ftp_pass = ""; break; case "koishikawa": $ftp_user = "staff"; $ftp_pass = ""; break; case "honma": $ftp_user = "staff"; $ftp_pass = ""; break; case "yamazaki": $ftp_user = "staff"; $ftp_pass = ""; break; case "kayo": $ftp_user = "staff"; $ftp_pass = ""; break; case "araya": $ftp_user = "staff"; $ftp_pass = ""; break; case "yamazaki": $ftp_user = "staff"; $ftp_pass = ""; break; case "ando": $ftp_user = "staff"; $ftp_pass = ""; break; case "kumi": $ftp_user = "staff"; $ftp_pass = ""; break; case "takemura": $ftp_user = "staff"; $ftp_pass = ""; break; case "yoshida": $ftp_user = "staff"; $ftp_pass = ""; break; case "eto": $ftp_user = "staff"; $ftp_pass = ""; break; case "rallye": $ftp_user = "staff"; $ftp_pass = ""; break; default: $ftp_user = "uploader2"; $ftp_pass = ""; break; } $ftp = ftp_connect("221.255.244.20"); if(ftp_login($ftp, $ftp_user, $ftp_pass)) { $k = 1; for($i=0; $i<10; $i++) { /* $MAXSIZE += $FileSize[$i]; if($MAXSIZE > 200000000) {//最大容量チェック 現在は200MBまで header('Location:https://www.discoveryfirm.com/upload/upload.php?error=2'); return; } */ if($FileName[$i]) { //拡張子チェック用配列 $ASCII = array('txt','html','cgi','pl','php','log'); $BINARY = array('mp3', 'jpeg', 'jpg', 'gif', 'ai', 'tif', 'eps', 'lzh' ,'MP3','JPEG','JPG','GIF','AI','TIF','EPS','LZH', 'pdf','zip','ZIP','tgz','TGZ'); $kakucyousi = explode(".",$FileName[$i]); $file_kakucyousi = array_reverse($kakucyousi); //$localfile = "c:/program files/apache group/apache/htdocs/download/$TRUEFILE[$i]"; //$remotefile ="/1/$Folder/$FileName[$i]"; $remotefile ="/".$Folder."/".$FileName[$i]; if(in_array($file_kakucyousi[0], $ASCII)) {//●ダウンロード処理------------------- if(ftp_put($ftp,$remotefile,$FileTmpPath[$i],FTP_ASCII)) { $FTPFILE .= "$FileName[$i]\r\n"; $k++; } else { header('Location:https://www.discoveryfirm.com/upload/upload.php?error=3'); } } else { if(ftp_put($ftp,$remotefile,$FileTmpPath[$i],FTP_BINARY)) { $FTPFILE .= "$FileName[$i]\r\n"; $k++; } else { header('Location:https://www.discoveryfirm.com/upload/upload.php?error=4'); } } } } } ftp_close($ftp); $res_dir = opendir( '.' ); while($file_name = readdir( $res_dir )) { switch($file_name) { case '.': break; case '..': break; case 'ftpserver.php': break; case 'httpdelete.php': break; case 'receive.php': break; default: @unlink($file_name); break; } } closedir( $res_dir ); mb_internal_encoding("SJIS"); mb_language('ja'); $mail = $_REQUEST[mail]; //$sub1 = "FTPアップローダー アップロード完了メール"; $sub1 = "FTP UPLOAD COMPLETE"; //$emailsubject = "FTPアップローダー アップロード完了メール\r\n"; $msg .= "このメールは「Discoveryアップローダー」のアップロード完了メールです。\r\n\r\n"; $msg .= "下記のフォルダにデータアップされました。\r\n"; $msg .= "\r\n"; $msg .= "-----------------------------------------\r\n\r\n"; $msg .= "■フォルダ名\r\n\r\n".$Folder."\r\n\r\n"; $msg .= "■アップロードファイル\r\n\r\n"; $msg .= $FTPFILE; $msg .= "\r\n"; $msg .= "ダウンロード有効期限はフォルダ作成日より一週間となっています。\r\n"; $msg .= "-----------------------------------------\r\n\r\n"; $msg .= $_REQUEST[conmment]; $FROM = "From:[email protected]"; mb_send_mail($mail, $sub1, $msg, $FROM); //mb_send_mail($mail, "New FTP Upload", "Folder: $Folder\r\nFile name: {$FTPFILE}You have one week to download this file.", $FROM); header('Location:https://www.discoveryfirm.com/upload/end.php'); /* if($MAXSIZE >= 200000000) { header('Location:https://www.discoveryfirm.com/upload/upload.php?error=5');} elseif($MAXSIZE <= 199999999 && $MAXSIZE >= 1){ header('Location:https://www.discoveryfirm.com/upload/end.php'); } else { header('Location:https://www.discoveryfirm.com/upload/upload.php?error=6');} */ ?> Help please. Link to comment https://forums.phpfreaks.com/topic/251180-omg-smtp-and-smtp_port-setting-in-phpini-or-use-ini_set/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.