close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

.dat file attachments

Thread began 2/15/2011 5:41 pm by lbunnell124698 | Last modified 2/24/2011 12:18 pm by Jason Byrnes | 1188 views | 5 replies |

lbunnell124698

.dat file attachments

I'm using Universal Email and the file is sending but the attachments are all being delivered as .dat files instead of .pdf files.

This sends unopenable .dat files:

$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"".$row_rsForms["attach_frm"] ."");

where $row_rsForms["attach_frm"] is a PDF file from the same directory level as the script that calls the Universal Email function. (i.e forms/somefile.pdf)

This sends no attachments:

$WA_MailObject = WAUE_AddAttachment($WA_MailObject,"/home/xxxx/public_html/PDF/".$row_rsForms["attach_frm"] ."");

Using Universal Email 3.0.7

Sign in to reply to this post

Jason ByrnesWebAssist

an you send a copy of your WA_UniversalEmail/mail_php.php page please.

Sign in to reply to this post

lbunnell124698

Here you go...

Attached Files
Mail_PHP.php.txt
Sign in to reply to this post

Jason ByrnesWebAssist

try changing lines 235 - 253:

php:
if(sizeof($mailObj->attachments) > 0)    {

    foreach ($mailObj->attachments as $fileArr)    {
      if (is_readable($fileArr[3]))    {
        if (strtolower($fileArr[1]) == "base64")     {
          $data = chunk_split(base64_encode(implode("", file($fileArr[3]))));
        }
        else     {
          $data = implode("", file($fileArr[3]));
        }
        $mailAttachments .= $lineEnd."--WAMULTIBREAKWA";
        $mailAttachments .= $lineEnd."Content-Type: ".$fileArr[0];
        $mailAttachments .= "; name=\"".basename($fileArr[3])."\"".$lineEnd;
        $mailAttachments .= "Content-Transfer-Encoding: ".$fileArr[1].$lineEnd;
        $mailAttachments .= "Content-Disposition: inline;";
        $mailAttachments .= " filename=\"".basename($fileArr[3])."\"".$lineEnd.$lineEnd;
        $mailAttachments .= $data;
      }
    }
  }




to:

php:
if(sizeof($mailObj->attachments) > 0)    {

    foreach ($mailObj->attachments as $fileArr)    {
        if (is_readable($fileArr[3]))    {
            if (strtolower($fileArr[1]) == "base64")     {
                $data = chunk_split(base64_encode(implode("", file($fileArr[3]))));
            }
            else     {
                $data = implode("", file($fileArr[3]));
            }
            $mailAttachments .= $lineEnd."--WAMULTIBREAKWA";
            $mailAttachments .= $lineEnd."Content-Type: ".$fileArr[0];
            if ($fileArr[2] != "")  {
                $mailAttachments .= "; name=\"".basename($fileArr[2])."\"".$lineEnd;
            }
            else  {
                $mailAttachments .= "; name=\"".basename($fileArr[3])."\"".$lineEnd;
            }
            $mailAttachments .= "Content-Transfer-Encoding: ".$fileArr[1].$lineEnd;
            $mailAttachments .= "Content-Disposition: inline;";
            if ($fileArr[2] != "")  {
                $mailAttachments .= " filename=\"".basename($fileArr[2])."\"".$lineEnd.$lineEnd;
            }
            else  {
                $mailAttachments .= " filename=\"".basename($fileArr[3])."\"".$lineEnd.$lineEnd;
            }
            $mailAttachments .= $data;
        }
    }
}
Sign in to reply to this post

lbunnell124698

That didn't seem to make any difference. The .pdf files are still being sent as .dat files

Any other suggestions?

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...