ME- Sending mail ?

    ME- Sending mail ?

    Hi guys,

    Another "quick question" about ME : I want to send a mail to users. I know there is a php function called mail() which can normaly do the job. However, after testing I'm not receiving my tests' mails.

    Do you have any tips about that ?

    I'm considering another way to send a mail :

    PHP Source Code

    1. $to="";
    2. $subject="subject";
    3. $message="<3 u";
    4. return array(
    5. array('hl', 'mailto:'.$to.'?subject='.$subject.'!&Body='.$message)
    6. );

    Well it "works" since it open my default mail programm, but I really want to have an automated code, working without any user's action (if able).

    Thanks :)
    Well you can set up a Hyperlink that opens your file with the corresponding macro. In this file (report / or .wss) you can create the __open function, which is invoked upon opening the file.

    PHP Source Code

    1. function __open() {
    2. $to="";
    3. $subject="subject";
    4. $message="<3 u";
    5. return array(
    6. array('hl', 'mailto:'.$to.'?subject='.$subject.'!&Body='.$message)
    7. );
    8. }

    Hope it helps.

    This will work for sure, but the fact is that mailto: opens the default mail client and then require manual sending.

    I wish I could use the mail() function from PHP, but it doesn't seem to work. May be I have to look in the conf... But I'm not sure at the moment.
    As laloune already answered, I would recommend adding a library / framework too. That's the neat thing about the macro engine.

    If you need to process a more complex mail app you could also set up a widget, within your worksheet, where you could fetch some data from the db or the worksheet itself using the same Jedox functionality.

    Data is passed to Widget for example as range (source), where it receives an array

    Source Code

    1. params[i]
    for every cell or you could make use of Palosubset and Palodata functions. PHP works as well in the widget. Examplets can be found in your Jedox/Jedox Suite/httpd/app/docroot/pr/jedox folder (your code should go to the pr/custom folder) the advantage is you can make use of JavaScript and HTML5 and CSS there.

    Greets Peter.

    Post was edited 4 times, last by “Peter Parks” ().