PHP Classes

Really simple(?) script won't work

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Really simple(?) script won't work  >  (Un) Subscribe thread alerts  
Subject:Really simple(?) script won't work
Summary:fatal php error :O
Messages:2
Author:Arek Koc
Date:2013-02-28 02:52:46
Update:2013-02-28 03:01:58
 

  1. Really simple(?) script won't work   Reply   Report abuse  
Picture of Arek Koc Arek Koc - 2013-02-28 02:52:46
After a few hours I really don't know what is wrong here, the error appears on line with CreateAlternativeMultipart, the script looks very simple:

$obraz['FileName']='1.jpg';
$obraz['Content-Type']='automatic/name';
$obraz['Name']='1.jpg';
$obraz['Disposition']='inline';
$obraz['Cache']=1;

$message_object->CreateFilePart($obraz,$img);
$message_object->CreateQuotedPrintableTextPart('Alternative','',$txt);
$message_object->CreateQuotedPrintableHTMLPart('<html><head></head><body><h1>Test</h1><img src=cid:'.$message_object->GetPartContentID($img).'></body></html>','',$html);

#line 23:
$message_object->CreateAlternativeMultipart(array($txt,$html),$txtandhtml);
$message_object->CreateRelatedMultipart(array($txtandhtml,$img),$all);
$message_object->AddRelatedMultipart(array($all));

print $message_object->Send();

PHP Fatal error: Cannot pass parameter 1 by reference in htmlmail.php on line 23

Thanks for any advice :(

  2. Re: Really simple(?) script won't work   Reply   Report abuse  
Picture of Arek Koc Arek Koc - 2013-02-28 03:01:58 - In reply to message 1 from Arek Koc
Solved

Have to change

$message_object->CreateAlternativeMultipart(array($txt,$html),$txtandhtml);

to

$a1=array($txt,$html);
$message_object->CreateAlternativeMultipart($a1,$txtandhtml);