나는 AJAX & jQuery를 사용하여 양식을 확인하고 제출하는 PHP 메일 양식을 가지고 있습니다. 모든 것이 잘 작동하는 것처럼 보이지만 어떤 이유로 든 내 클라이언트 (웹 사이트 소유자)는 각 메일을 여러 부 복사하여 보냅니다. 인쇄 매수는 특정 패턴없이 각 메시지의 1 부에서 10 부까지 다양합니다.PHP 메일 양식 수신자 여러 복사본 받기
개인적으로 수행 한 모든 테스트에서 저는 업무용 전자 메일 주소와 다른 gmail 계정에서도 메시지 사본 1 부를받습니다. 그러나 도메인 등록 기관에서 전자 메일 계정을 호스팅하는 클라이언트는 최대 10 개의 사본을 한 번에받을 수 있습니다.
우리는 웹 사이트를 호스팅하고 있기 때문에 메시지가 전송 될 때마다 당사 서버가 양식을 처리하고 있습니다. 우리의 서버 메일 로그를 확인한 후 한 번만 발송되었음을 확인할 수 있습니다.
이것은 나를 미치게합니다. 우리는이 문제를 파악하고이 문제로 낭비되는 매분마다 돈을 잃으려고 많은 시간을 소비하지 않고 있습니다.
나는 내 코드와 라이브 웹 사이트를 제공해 드리겠습니다. 잘만되면 누군가 나를 도울 수있다!! http://www.energywisesolutions.ca/
양식 슬라이드가 열려 볼 수있는 '책에게 홈 평가'링크/버튼을 클릭 할 수 있습니다 : 우선
, 여기 당신이 행동 양식을 볼 수있는 웹 사이트입니다.
이
내가 양식 유효성 검사를 위해 사용하고 스크립트입니다 : 여기http://www.position-relative.net/creation/formValidator/ 내 폼 유효성 검사이며, 다음 스크립트를 보낼 형성 : 여기
$(document).ready(function() {
/* ASSESSMENT FORM
----------------------------------------------------------------*/
// Form Validation
$("#contact-form .send").click(function(){
$("#contact-form").validationEngine('attach', {
onValidationComplete: function(form, status){
if(status==true){
$("#contact-form .send").clone().insertAfter($(this)).attr("disabled","true");
$("#contact-form .send").hide();
_gaq.push(['_trackPageview', '/online-thankyou']);
$.post('/themes/energywise/mail-form/process.php', $("#contact-form").serialize(), function(data) {
// Add Thank You Message
$('#thank-you-message').html(data);
// Create IFRAME to page with Adwords Tracking Script
function ppcconversion() {
var iframe = document.createElement('iframe');
iframe.style.width = '0px';
iframe.style.height = '0px';
document.body.appendChild(iframe);
iframe.src = 'http://www.energywisesolutions.ca/themes/energywise/mail-form/conversion-script.php';
};
ppcconversion();
});
}
}
});
});
});
그리고는 내 양식 프로세스 스크립트 :
$toAdmin='[email protected]';
$fromAdmin='[email protected]';
$toVisitor=stripslashes($_POST['email']);
$name=stripslashes($_POST['full_name']);
$city=stripslashes($_POST['city']);
$phone=stripslashes($_POST['phone']);
$comments=stripslashes($_POST['comments']);
/* TO ADMIN */
$headersToAdmin = "From: " .$toVisitor. "\r\n";
$headersToAdmin .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subjectToAdmin='Energywise Website Lead - Home Assessment Form';
$messageToAdmin = '<html><body>';
$messageToAdmin .= '<img src="http://www.energywisesolutions.ca/energy-rebates/form1.jpg" alt="Home Assessment Form" />';
$messageToAdmin .= '<p>A website visitor has filled out thea Home Assessment Form. Here is their information and the comments they provided:</p>';
$messageToAdmin .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$messageToAdmin .= "<tr style='background: #eee;'><td><strong>Sent From:</strong> </td><td>ENERGYWISE WEBSITE</td></tr>";
$messageToAdmin .= "<tr><td><strong>Name:</strong> </td><td>" .$name. "</td></tr>";
$messageToAdmin .= "<tr><td><strong>City:</strong> </td><td>" .$city. "</td></tr>";
$messageToAdmin .= "<tr><td><strong>Email:</strong> </td><td>" .$toVisitor. "</td></tr>";
$messageToAdmin .= "<tr><td><strong>Phone:</strong> </td><td>" .$phone. "</td></tr>";
$messageToAdmin .= "<tr><td><strong>Comments:</strong> </td><td>" .$comments. "</td></tr>";
$messageToAdmin .= "</table>";
$messageToAdmin .= "</body></html>";
/* TO VISITOR */
$headersToVisitor = "From: " .$fromAdmin. "\r\n";
$headersToVisitor .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subjectToVisitor='Thank you for Contacting Energywise Solutions';
$messageToVisitor = '<html><body>';
$messageToVisitor .= '<img src="http://www.energywisesolutions.ca/energy-rebates/form1.jpg" alt="Home Assessment Form" />';
$messageToVisitor .= '<p>Hello,</p>
<p>Thank you for contacting Energywise Solutions. We have received your message and will get in touch with you shortly.</p>
<p>Your information has been attached below:</p>';
$messageToVisitor .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$messageToVisitor .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" .$name. "</td></tr>";
$messageToVisitor .= "<tr><td><strong>City:</strong> </td><td>" .$city. "</td></tr>";
$messageToVisitor .= "<tr><td><strong>Email:</strong> </td><td>" .$toVisitor. "</td></tr>";
$messageToVisitor .= "<tr><td><strong>Phone:</strong> </td><td>" .$phone. "</td></tr>";
$messageToVisitor .= "<tr><td><strong>Comments:</strong> </td><td>" .$comments. "</td></tr>";
$messageToVisitor .= "</table>";
$messageToVisitor .= "</body></html>";
mail($toAdmin, $subjectToAdmin, $messageToAdmin, $headersToAdmin);
mail($toVisitor, $subjectToVisitor, $messageToVisitor, $headersToVisitor);
print "<h3><strong>Thank you for contacting us.</strong> We will get back to you as soon as possible.</h3>
<p>We have received your message and will get in touch with you shortly. If you have any immediate questions please feel free to give us a call. You can find the appropriate contact information for your region on our <a href='/locations/'>locations</a> page.</p>";
이 문제를 해결하는 데 도움이 필요한 것이 있으면 알려주십시오. 그것은 내 고객과 나 자신을 미치게합니다.
미리 감사드립니다.
만약 이것이 사실이라면 : _ "나는 우리 서버의 메일 로그를 검사하여 한번 밖에 발송되지 않았 음을 확인할 수 있습니다."_ (여러 사람에게 전달되지는 않음) 문제는 당신 편이 아닐 수 있습니다. 메일 서버가 이상하게 행동하고있는 것입니다. '$ toVisitor' **에 무엇이 있는지 확인하십시오. stripslashes'만으로는 충분하지 않습니다. 'filter_var'를 사용하십시오. – Wrikken
Wrikken 제안에 감사드립니다.'stripslashes' 대신'filter_var'을 구현했습니다. 문제가 해결되지 않았다고 생각하지만 입력을 고맙게 생각합니다. 내 메일 로그를 다시 확인해야 할 수도 있습니다. 내 이메일 주소를 관리자로 추가 한 이후로받은 편지함에 여러 사본을 받았습니다. 따라서 메일 서버에만 해당되지는 않습니다. – norsewulf
문제가 없으며 도움이됩니다. 로그가 맞을 가능성이 높습니다. 문제는 측면입니다 ... 메일 서버는 메일 서버가 실패했다고 생각하고 나중에 자동으로 대기열에 다시 대기시킵니다. 메일 서버 성공이라고 생각하기 때문에), 당신은 따 직접 SMTP를 테스트하여 해당 서버를 테스트합니다. – Wrikken