0

私は連絡先ページと連絡先ページからのフォームデータが問題に投稿されているページを持っています.XAMPPを使用してlocalhostからpearメールを使用して電子メールを送信できますが、ファイルをアップロードするとサーバーで機能しません.何も問題はありません. Outlookを使用してメッセージを送信できますが、サーバーの送信smtp. データが投稿されるページは次のとおりです。

<?php
include_once('Mail.php');
include_once ('securimage/securimage.php');
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
  echo "<p>The captcha code you entered is wrong<br/></p>";
  exit;
}
$clientip=$_SERVER['REMOTE_ADDR'];
$name=$_POST['txtname'];
$family=$_POST['txtfamily'];
$email=$_POST['txtemail'];
$message=$_POST['txtmessage'];
$to = 'nowrouziehsan@gmail.com';
$from=$email;
$subject = 'Sent from my website';
$body ="Name : ".$name."\n"."Family : ".$family."\n"."Email : ".$email."\n".
"Client IP Address : ".$clientip."\n"."Message :\n".$message;
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);

$smtp = Mail::factory('smtp', array(
    'host' => 'mail.alijamshidi.org',
    'port' => '25',//it works fine on the port 587 as well...
    'auth' => true,
    'username' => 'info@alijamshidi.org',
    'password' => 'mypassword'
));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo('<p>' . $mail->getMessage().'</p>');
} else {
echo('<p>You have successfully sent the message , stay in tune while we reply you
back</p>');
}
?>
4

0 に答える 0