私はメールを送信するメールを受け取りました($mail->send()
が真を返すので)。エラーは表示されていないので、私はすべてが機能していると仮定していますが、何とか私のメールはどこにも届きません。 Gmailではなく、Outlookではありません。何が問題なの?私はうまく動作する同じサーバー上の別のドメインからいくつかのテストメールを送信しました。メールは送信されますがどこにも届かない
私が送っているドメインは新品ですので、それはブラックリストに載せられているか、それとも何かを疑っています。
私のHTMLフォーム:
<form id="contact-form" class="contact-form" method="post" action="mail/mail_send.php" role="form">
<div class="error-container"></div>
<input type="text" placeholder="Naam *" class="name form-control-name" name="name" required>
<input type="email" placeholder="E-mail *" class="email form-control-email" name="email" required>
<input style="width:100%;" type="text" placeholder="Telefoonnummer" class="phone form-control-phone" name="phone">
<textarea name="message" placeholder="Bericht *" class="message form-control-message" rows="8" cols="20" required></textarea>
<input type="submit" name="submit" value="Verzenden">
</form>
私のAjaxのスクリプト:
$('#contact-form').submit(function(){
var $form = $(this),
$error = $form.find('.error-container'),
action = $form.attr('action');
$error.slideUp(750, function() {
$error.hide();
var $name = $form.find('.form-control-name'),
$email = $form.find('.form-control-email'),
$phone = $form.find('.form-control-phone'),
$message = $form.find('.form-control-message');
$.post(action, {
name: $name.val(),
email: $email.val(),
phone: $phone.val(),
message: $message.val()
},
function(data){
$error.html(data);
$error.slideDown('slow');
if (data.match('success') != null) {
$name.val('');
$email.val('');
$phone.val('');
$message.val('');
}
}
);
});
私のPHPのメールスクリプト:
<?PHP
require_once("../phpMailer/class.phpmailer.php");
$isValid = true;
if(isset($_POST['name']) && isset($_POST['mail']) && isset($_POST['phone']) && isset($_POST['message']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$subject = 'Er is een aanvraag op de website van website\'s Hairdesign';
$mail = new PHPMailer;
$mail->From = $email;
$mail->FromName = $name;
$mail->addAddress("[email protected]");
$mail->isHTML(true);
$mail->Subject = $subject;
$texts = 'Er is een aanvraag op de website van website\'s Hairdesign<br /> <br />
<b>Naam:</b> '.$name.'<br />
<b>E-mail adres:</b> '.$email.'<br />
<b>Telefoonnummer:</b> '.$phone.'<br />
<b>Bericht:</b> '.$message.'<br /><br /><br />
';
$handtekening = '
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="font-family:calibri;color: #5C5C5C; font-size:10pt;line-height:22px;">
<tr>
<td width="160" valign="top" style="font-family:calibri;padding-left:10px;padding-top:20px;">
[contents]
</td>
</tr>
<tr>
<td width="160" valign="top" style="font-family:calibri;padding-left:10px;padding-top:20px;">
Helpdesk<br>
<b>website\'s Hairdesign</b><br>
<p></p>
</td>
</tr>
</table>
<table height="120" border="0" width="100%" cellspacing="0" cellpadding="0" style="font-family:calibri;color: #5C5C5C; font-size:10pt;line-height:22px;">
<tr>
<td width="250" valign="top" style="font-family:calibri;padding-left:10px;padding-top:20px;border-top: 1px #000000 dotted; border-bottom: 1px #000000 dotted;">
E:
<a href="mailto:[email protected]" style="font-family:calibri;color: #5C5C5C; text-decoration: none; border-bottom: 1px #5C5C5C dotted;">[email protected]</a><br>
T:
<a href="tel:+310181506451" style="font-family:calibri;color: #5C5C5C; text-decoration: none; border-bottom: 1px #5C5C5C dotted;">+31-(0)181-506451</a><br>
W:
<a href="http://websiteshairdesign.nl/" style="font-family:calibri;color: #5C5C5C; text-decoration: none; border-bottom: 1px #5C5C5C dotted;" target="_blank">www.podlogistics.nl</a><br>
</td>
<td align="right" style="font-family:calibri;padding-right:10px;padding-top:5px;border-top: 1px #000000 dotted; border-bottom: 1px #000000 dotted;">
<a href="http://websiteshairdesign.nl/" target="_blank" title="Ga naar de website">
<img src="http://websitemedia.nl/_extern/websites/img/logo-websites.png" alt="Ga naar de website" style="font-family:calibri;text-align:right;margin:0px;padding:10px 0 10px 0;" border="0" width="232">
</a>
</td>
</tr>
<tr>
<td colspan="2" style="font-family:calibri;color:#a3a3a3;font-size:11px;margin-top:6px;line-height:14px;">
<br>Dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Als dit bericht niet voor u bestemd is, wordt u vriendelijk verzocht dit aan de afzender te melden. website\'s Hairdesign staat door de elektronische verzending van dit bericht niet in voor de juiste en volledige overbrenging van de inhoud, noch voor tijdige ontvangst daarvan. Voor informatie over website\'s Hairdesign raadpleegt u <a href="http://websiteshairdesign.nl/" style="font-family:calibri;color: #5C5C5C; text-decoration: none; border-bottom: 1px #5C5C5C dotted;" target="_BLANK">website\'s Hairdesign</a>.<br><br>
</td>
</tr>
</table>';
$contents = preg_replace('/\[contents]/',$texts, $handtekening);
$mail->msgHTML($contents);
$mail->AltBody = $texts;
if(!$mail->send())
{
$isValid = false;
}
$mail = new PHPMailer;
$mail->From = '[email protected]';
$mail->FromName = 'website\'s Hairdesign';
$mail->addAddress($email);
$mail->isHTML(true);
$mail->Subject = 'Bedankt voor uw aanvraag bij website\'s Hairdesign';
$texts = 'Geachte heer/mevrouw '.$naam.',<br /><br />
Hartelijk dank voor uw aanvraag, wij zullen hier zo spoedig mogelijk op reageren.<br />
<br>
Met vriendelijke groet,
';
$contents = preg_replace('/\[contents]/',$texts, $handtekening);
$mail->msgHTML($contents);
$mail->AltBody = $texts;
if(!$mail->send())
$isValid = false;
}
if($isValid == true) {
$result = 'Bedankt voor uw aanvraag! Wij nemen z.s.m. contact met u op.';
} else {
$result = 'Vul alle velden in!';
}
echo $result;
ローカルメールサーバーのログには何が表示されますか? (通常は '/ var/log/mail.log'にあります) – Synchro
@シンクロ私は自分のサーバ上でそれらを見つけることができません。私はメールフォルダを持っていますが、これはログではなく、このドメインのすべてのメールアドレスのみを含んでいます。 – twan
私はあなたがSMTPをlocalhostに使うことをお勧めします:SMTPクラスを組み込み、 '$ mail-> isSMTP();'を呼び出し、 '$ mail-> Host = 'localhost';'を設定します。同じように動作するはずですが、送信プロセスについてさらに多くのフィードバックを得ることができます( '$ mail-> SMTPDebug = 2'を設定してください)。 – Synchro