No announcement yet.

Sc_mail_send attachment problem

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sc_mail_send attachment problem

    Hi guys,

    I made an php button to send an email with the attachment of wich the filename is stored in the current record and the attachment is uploaded to _lib/file/doc. My problem is that whatever I try my attachment is not attached tot my email.

    This is what I have done :
    - In the onload event I save the attachments name into the global variable [attachment].
    - In my mail definition I have : $mail_attachment = $this->Ini->path_doc.'/'.[attachment];
    - this parmeter is the last parameter in sc_mail_attachment

    When I glue this string onto my content everything looks nice /home/<mylinuxuser>/domains/<mydomainname>/private_html/npl3/_lib/file/doc/<myfilename>. Yes that looks the right path from root and the document is there. Check.

    The scriptcase documentation and the example look a little bit contraditionary: in the documentation is stated that is the attachment value should contain the absolute path to the document. But in the scriptcase example it is an array. What is it an absolute path or an array containing the absolute path ?

    // ****************** SCRIPTCASE EXAMPLE ************************************************** ***********//
    $mail_attachments = array( // List of attached files (located on the web server)
    // ************************************************** ************************************************** ********* //
    I also tried this example No result.

    When I try putting in in an array scriptcase raises an exeption "Array to string conversion". But no error when I put this code
    $mail_attachments = $this->Ini->path_doc.'/'.[attachment]; The example given the correct parameters does not work.

    My mail is ok but my attachment does not arrive ???? Where do I go wrong?? Suggestions will be very welcome.

    Last edited by roelof; 03-03-2016, 07:34 AM.

  • #2

    This problem kept me busy for a day. But it finally works.

    This is the correct way to do it: (the rest of the parameters is different for each user)
    The document name is stored in $doc1.

    $mail_copies = {ccmail};
    $mail_tp_copies = '';
    $mail_subject = $param_subject; // Message body
    $mail_format = 'H'; // Message format: (T)ext or (H)tml
    $mail_attachment = $this->Ini->path_doc.'/'.$doc1;
    $mail_message = $param_message;



    • #3
      Exactly. The attachment needs a full path to the file
      Professional Scriptcase Services
      Support/Outsourcing/Mentoring for projects migration to Cuba-Platform