CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> PHP

 PHPMailer addAttachment

Print topic Send  topic

Author Message

Posts: 11
Posted: 06/01/2016, 9:21 AM

Hi All,

I am using php mailer to add attachment to email.

I am not able to get attachment working when I call file name from database. But works if I manually add in. For example

This works


This does not work

$up11 = CCDLookUp("up1", "tbl_reminders", "remind_id=".
$DBcamain->ToSQL($RecField, ccsText), $DBcamain);

$path = "CAUploads\\emailup\\".$up11;
$path1 = "CAUploads/emailup/".$up11;


Any ideas why? I have printed $up11 and gives file name e.g.201606011654390.Lighthouse.jpg
View profile  Send private message

Posts: 513
Posted: 06/08/2016, 11:45 PM

@beefcake - at first glance it appears fine.

I would suggest checking the $path and $path1 is returning, not just $up11, and perhaps try single quotes instead of double quotes when concatenating them. PHP *might* by escaping something and getting the wrong file path.



CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message

Posts: 11
Posted: 06/09/2016, 6:37 AM

Thanks Eric.

I worked out the code was in fact fine but the file only gets picked up from the temporary upload folder! e.g. CAUploads/tmpup.

The email code is part of a records after insert event so I would expect the file transfer from temp to live to have already occurred.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.