我使用mandrillapp使用以下方法进行邮寄。但我需要从扫描仪发送JPEG或PDF或PNG扫描副本。
我该怎么办呢?
public static function sendBcc($from, $to, $subject, $htmlBody,
$bcc = '', $bcc1 = '', $utype = '') {
$bcc = '', $bcc1 = '', $utype = '') {
$uri = 'https://mandrillapp.com/api/1.0/messages/send.json';
$postData = array(
'key' => 'aaa',
'message' => array(
'html' => $htmlBody,
'text' => $htmlBody,
'subject' => $subject,
'from_email' => $from,
'from_name' => 'a',
'to' => array(
array('email'=>$to, 'name' => 'a', 'type' =>'to'),
array('email'=>$bcc,'name' => 'Bcc 1', 'type' => 'bcc'),
array('email'=>$bcc1,'name' => 'Bcc 2', 'type' => 'bcc')
),
),
);
$postString = json_encode($postData);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($ch);
//curl_close($ch);
}