2014-04-08 17 views
6

php ile sendgrid kullanıyorum, her iki seçeneği de istemci kütüphanesi ve curl seçeneğini kullandım. Şimdiye kadar, e-postaları doğrudan sorun olmadan addTo seçeneğiyle gönderebiliyorum. Ancak Cc veya Bcc seçeneklerini eklemeye çalıştığımda, e-posta hala gönderilir ancak kopyalar asla teslim edilmez. Php sürümü ile bilinen herhangi bir sorun var mı? Diğer projede java kütüphanesi gayet iyi çalışıyor. İşte SendGrid Cc ve Bcc PHP üzerinde çalışmıyor

Ben

<?php 
require ('sendgrid/sendgrid-php.php'); 

$sendgrid = new SendGrid('user', 'pwd'); 

$mail = new SendGrid\Email(); 
$mail ->addTo("[email protected]"); 
$mail ->addCc("[email protected]"); 
$mail ->setFrom("[email protected]"); 
$mail ->setSubject("TEST"); 
$mail->setHtml("<h1>Example</h1>"); 
$sendgrid->send($mail); 

?> 
+0

var_dump ($ posta) ve – Hackerman

cevap

7

dokümantasyon addCc yöntemine sahip görünmüyor çalışması yapmaya çalışıyorum basit bir kod parçasıdır. Bu alternatifleri deneyebilirsiniz.

$mail = new SendGrid\Email(); 
$mail->addTo('[email protected]')-> 
     addTo('[email protected]')-> 
     addTo('[email protected]'); 

veya

$mail = new SendGrid\Email(); 
$mail->addBcc('[email protected]'); 
$sendgrid->send($mail); 

https://github.com/sendgrid/sendgrid-php#bcc

+0

Çoklu addto Bcc taklit etmek hüner yok çıkış sonrası, ancak kendi ile gönderilecek e-postalar gerek Cc ve Bcc. AddCc yöntemi belgelerde görünmez, ancak kütüphanede bulunur. – Mike

+0

Onlar addCc'yi belgelerden kaldırdılar. https://github.com/sendgrid/sendgrid-php/commit/7d5e428321db6419829eb52a206364b072182d81 – comrade

+0

Ayrıca, bu sorunu burada da giderebilirsiniz. https://github.com/sendgrid/sendgrid-php/issues/83 – comrade

İlgili konular