Emailing from NAV

Andrew_LeesAndrew_Lees Member Posts: 4
Hi,

When a NAV report layout is previewed, you can go to 'file' and select 'send' and then go to 'send report by email'. When this is pressed the report transposes itself into the body of the email.

Does anybody know how this is achieved?

Many Thanks

Andy.

Comments

  • kinekine Member Posts: 12,562
    This is archived directly by the NAV client .exe application. There is no C/AL code behind...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DaveTDaveT Member Posts: 1,039
    Hi Andrew,

    Kine is correct but if you want to mimic this your self you can create code for this.

    To mimic it direct is quite easy just use report.saveashtml and call NewMessage in the mail codeunit 397.

    The common solution is to save the report as pdf and then E-mail it

    Search to forum and you will lots of post relating to this.

    P.S. Welcome to Mibuso :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • cssgyulacssgyula Member Posts: 31
    Hi there,

    I would like to use this cool feature of sending reports via e-mail, but the e-mail address is always blank.

    How does this work actually? How to fill the e-mail address, what is the trick of using this function?

    Thanks for your help,
    Best Regards,

    Gyula (Jules) Csiák-Sedivy

    There are two things, which you cannot learn from books. True love and Software Coding.
  • KarenhKarenh Member Posts: 209
    Set up Mail as a variable for codeunit 397 Mail.

    After having saved the report as a pdf, get the correct customer, vendor or whatever record which contains the email address.

    Create variables for email subject,email body,CCEmail, and AttachFileName, and populate them.

    Then call the Mail codeunit:
    Mail.NewMessage(Cust."E-mail",CCEmail,
    Subject,Body,AttachFileName,TRUE);
    Mail.Send;


    The last parameter causes the email to be presented to the user to review before sending. If you want the email to be sent without review, the last parameter should be false.
Sign In or Register to comment.