0
メールを送信するためのPHPスクリプトをテストする必要があります。 \のinetpub \ wwwrootの\ WWW \ prd_reques:PHPMailerのさまざまな動作のPHPコード
Cにsend_test_mail.php
\ \のinetpub \ wwwrootの\ WWW \売上高:私は
Cから実行されているコードをコピー\ provaMail.php
これらのコードは、PHP 5.3.28でIIS 8サーバーによって実行されます。
<?php
//require './PHPMailerAutoload.php';
// start PHPMailerAutoload.php
function PHPMailerAutoload($classname)
{
//Can't use __DIR__ as it's only in PHP 5.3+
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
if (is_readable($filename)) {
require $filename;
}
}
spl_autoload_register('PHPMailerAutoload');
// end PHPMailerAutoload.php
$mail = new PHPMailer(true);
$mail->AddAddress("[email protected]");
$mail->MsgHTML("TEST old server");
try
{
$mail->Subject = "TEST INTERPLANET";
$mail->SetFrom("[email protected]");
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "mail.interplanet.it"; // sets the SMTP server
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->Username = "username"; // SMTP account username
$mail->Password = "password"; // SMTP account password
$result = $mail->Send();
}
catch (phpmailerException $e)
{
echo $e->errorMessage(); //Pretty error messages from PHPMailer
}
catch (Exception $e)
{
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
私はこの行動の理由を理解したいと思います...
アップデート1 私は私が見つけたPHPMailerAutoload.phpスクリプト
コードを実行するとどうなりますか?あなたは何を期待しましたか? 1つの可能な問題は、相対パスを使用する 'require'ステートメントかもしれません。 – user2393256
「異なる動作」が何であるかを述べる必要があります。 – Synchro
_send_test_mail.php_スクリプトは、_Mail.php_noを試しているときに実行するとメールを送信します。 – salem