Attached mail in email is empty (0 bytes)

(5 posts) (2 voices)
  1. benan, Member

    Hi,

    i am playing around with sending out emails through mydbr. That works so far. Now instead of having the results directly in the email from a report, I wanted to attach a file directly from a report. I found the example for that in the documentation. So I created the example, but when I run it, the attached file is just empty with 0 bytes file size. Here is the code:
    DROP PROCEDURE IF EXISTS sp_DBR_MailReport $$ CREATE PROCEDURE sp_DBR_MailReport() BEGIN

    select 'dbr.mail'; select 'dbr.mail.sender', 'address@gmail.com', 'Ben'; select 'dbr.mail.attach', 'report.csv', 'https://myDomain/mydbr/report.php?r=17&m=1&h=bc98e7d3cc276ec344deb9af5ac3155069d22b12&i=1&export=csv';

    select 'address@gmail.com', 'Ben', 'Notification', 'Attached Report';

    END $$

    If I run the included report URL directly it creates the file and I can download it, including the correct content. I first tried it with PDF, that also resulted in an empty file. Because I dont have the wkhtmltopdf extension installed, I thought it could be because of that, thats why I changed it to csv, but that also results into an empty file.

    It would be great if you could help me figuring out why these attached files are empty.

    Thanks,
    benni

  2. myDBR Team, Key Master

    Benni,
    see that you are using https. Do you have a valid certificate in the server? myDBR checks that the sertificate is valid. If this is the problem, we could add an option to skip the certificate check.

    --
    myDBR Team

  3. benan, Member

    Hi,

    the certificate should be valid and the report also works when called manually. I dont get any warnings about a non valid certificate, so I assume thats OK.

    Thanks,
    benni

  4. benan, Member

    Just checked the Certificate to make sure. The certificate is valid. I guess that should not be the issue. Unfortunately I cannot test it only on http, because the server is only configured for https and my development machine only has a community license installed.

    Any ideas what I could test to see where the issue might be?

    Thanks,
    benni

  5. myDBR Team, Key Master

    Benni,
    there is a remote possibility that the server does not recognize the sertificate (the attachment is accessed from the server). You could try run the updater and set false to ignore_ssl parameter which is now the third parameter for the dbr.mail.attach-command:

    select 'dbr.mail.attach', 'report.csv', 'https://myDomain/mydbr/report.php?r=17&m=1&h=bc98e7d3cc276ec344deb9af5ac3155069d22b12&i=1&export=csv', false;

    --
    myDBR Team


Reply

You must log in to post.