2013-07-03 2 views
1

PHP 메일 기능을 사용하여 메일을 보내고 있습니다. 다른 모든 메일 서버로 전달되지만 gmail은 전달되지 않습니다.메일이 Gmail로 배달되지 않습니다.

여기에 어떤 도움이 높게 평가 될 것입니다 내 헤더

$headers = "From: Somename<[email protected]>\r\n"; 
$headers .= "Reply-To: [email protected]\r\n". 
$headers .="Return-Path: [email protected]\r\n"; 
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 
$headers .='X-Mailer: PHP/' . phpversion(); 

입니다. 고맙습니다.

+1

안녕하세요. 이미 '관련'항목에 중복 된 항목이 많습니다. –

+0

Gmail은 스팸으로 감지하고 있습니다 (특히 공유 호스팅 제공 업체에있는 경우). –

+0

서버/PHP 설치가 mail() 함수의 사용을 지원합니까? 또한 스팸/정크 등을 확인 했습니까? –

답변

1

난 당신이

을 참조 require_once를의 클래스에 맞는 장소를 설정하는 것을 잊지 마세요 코드를 시도 솟구쳐 경우 당신의 헤더 대신

$headers .= "Reply-To: [email protected]\r\n"; 

에서

당신은 잘못 입력 '.' ';'대신에 그 원인 오류입니다.

+0

예. 실제로 문제였습니다. 그 점을 지적 해 주셔서 감사합니다. – tousif

1

까지 난 당신이 그래서 내가 이메일을

코드 보내 Gmail을 사용하면 코드 메신저를 게시 할 예정입니다 무슨 잘못 그래서 내가 볼 수있는 코드의 나머지 부분을 제공하지 않는 참조로 :

$sendmail = require_once('../lib/phpmailer/class.phpmailer.php'); 
include("../lib/phpmailer/class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded 

$mail    = new PHPMailer(); 

$body = " Body Msg "; 

$mail->IsSMTP(); // telling the class to use SMTP 
$mail->SMTPAuth = true;     // enable SMTP authentication 
$mail->Host  = "smtp.gmail.com"; // sets the SMTP server 
$mail->Port  = 465;     // set the SMTP port for the GMAIL server 
$mail->Username = "[email protected]"; // SMTP account username 
$mail->Password = "pass";  // SMTP account password 

$mail->SetFrom('$qemail', 'first name'); 

$mail->Subject = "hi name"; 

$mail->MsgHTML($body); 

$address = "[email protected]"; 
$mail->AddAddress($address, "first name"); 

if(!$mail->Send()) { 
    echo "Mailer Error: " . $mail->ErrorInfo; 
} 

당신은 포함 기능과

+0

확인이 당신의 노력 에 대한 – tousif

+0

일 전에 that.Thanks에게 그래 사용한 PHP 메일러 클래스를하려고합니다 :) 알고 @tousif – tousif

관련 문제