This topic is locked
[SOLVED]

 mail with attachement

12/21/2013 9:24:00 AM
PHPRunner General questions
J
jacques author

Ik need some help with attachements to a mail

The mail is send ok but no attachements at all.
From the manual

(http://xlinesoft.com/phprunner/docs/send_an_email_with_attachment.htm)
My code

$bijlage = "bijlage [{"name":"cv\/Danny rapportages_x497iif7.pdf","usrName":"Danny rapportages.pdf","size":118988,"type":"application\/pdf","searchStr":"Danny rapportages.pdf,!:sStrEnd"}]";
$fileArray = my_json_decode($bijlage);

$attachments = array();

foreach($fileArray as $f)

{

$attachments[] = array("path" => $f["name"]);

}
$ret= runner_mail( array(

'from'=> $_SESSION["ifrom"],

'fromName'=> $_SESSION["inaam"],

'to' => $email,

'cc'=> $_SESSION["icc"],

'bcc'=> $_SESSION["ibcc"],

'replyTo' => $_SESSION["ireplyto"],

'subject' => $subject,

'htmlbody' => $msg,

'charset' => 'iso-8859-1',

'attachments'=> $attachments

) );
Everything else is going well but there are no attachements.

I checked the $bijlage and it is ok as well
Help
Jacques

Sergey Kornilov admin 12/22/2013

Check the content of $fileArray array after you put decoded JSON there. You can print the content of array using print_r() function.

J
jacques author 12/22/2013



Check the content of $fileArray array after you put decoded JSON there. You can print the content of array using print_r() function.



Sergey
print_r(fileArray)
Array ( [0] => Array ( [name] => cv/Danny rapportages_x497iif7.pdf [usrName] => Danny rapportages.pdf [size] => 118988 [type] => application/pdf [searchStr] => Danny rapportages.pdf,!:sStrEnd ) )
print_r(attachments) after foreach
Array ( [0] => Array ( [path] => cv/Danny rapportages_x497iif7.pdf ) )
Adding getabspath() did not help
gr Jacques

Sergey Kornilov admin 12/23/2013

Looks good to me. Make sure file cv/Danny rapportages_x497iif7.pdf file exists on the web server.
If you need more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

J
jacques author 12/24/2013



Looks good to me. Make sure file cv/Danny rapportages_x497iif7.pdf file exists on the web server.
If you need more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Sergey,
Sorry for your time

In your manual is written:
"Attachments will work only when using Custom mail server settings"
I've read ik dozens of times but I've read over it.
Gr Jacques

Sergey Kornilov admin 12/24/2013

Yes, this is the important part. The built-in PHP mail() function doesn't have an option to send email attachments. This will only work with custom mailer.