PHPを使用して送信メールを送信しようとして、ファイルをサーバーにアップロードしました:timeoutfix.diff、smtp.inc.php、phpmailer.inc.php、それでもメールは送信されません。誰でも私を助けることができますか?
HTML フォーム:
<form method="post" action="contactengine.php">
<label for="Name">Name:</label>
<input type="text" name="Name" id="Name" />
<label for="Company">Company:</label>
<input type="text" name="Company" id="Company" />
<label for="Email">Email:</label>
<input type="text" name="Email" id="Email" />
<label for="Message">Message:</label><br />
<textarea name="Message" rows="20" cols="20" id="Message"></textarea>
<input type="submit" name="submit" value="Submit" class="submit-button" />
</form>
phpコード:
<?php
$Subject = "Email from test website";
$Name = Trim(stripslashes($_POST['Name']));
$Company = Trim(stripslashes($_POST['Company']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
require("phpmailer.inc.php");
$mail = new phpmailer;
$mail->IsSMTP(); // set mailer to use SMTP
$mail->From = "test@test.com";
$mail->FromName = " Gartner Israel";
$mail->Host = "62.219.91.15"; // specify main and backup server
$mail->AddAddress("myemail@gmail.com");
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Email from test website";
$mail->Body = $Body;
if ($mail->Send();){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>