Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Email not working for reports in D2007, RB11

edited October 2008 in General
Hi,

the following code used to work RB10.

I get the send dialogue, with all the correct files attached, but...

When I press send a thread is entered and then hangs for 2-3minutes, then
exits without any info.
No email is sent.

Please help

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
lEmail: TppEmail;
begin
lEmail := TppEmail.Create;
try
ppReport1.EmailSettings.Recipients.Add('emailaddress@host.com');
ppReport1.EmailSettings.Subject := 'ReportBuilder email test';
ppReport1.EmailSettings.Body.Add('ReportBuilder email test');

ppReport1.EmailSettings.Attachments.Append('D:\TestFile.CSV');

lEmail.AddReport(ppReport1);
lEmail.Send;

finally
lEmail.Free;

end;
end;

ALSO

If I use my old application that used to email reports from within the
reportviewer, I get the same result .. hangs for a while, nothing happens,
when pressing the email button in the report previewer.

Thanks in advance.

Regards

Adrian

Comments

  • edited October 2008
    Hi Adrian,

    If you are using Windows Vista and Outlook, you need to be sure Outlook is
    closed before sending an email with the MAPI plugin. This is a known
    Microsoft Vista issue and we are constantly monitoring their progress on a
    fix.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2008
    Hi Nico,

    You answer that:


    I forgot that, then closed WindowsMail in Vista bussiness, and I could then
    send email successfully.
    Then I decided to test your theory regarding the bug being with Microsoft.

    Please do the following little test.
    You will need Adobe Reader, I have used Verion 8.

    1). Generate a report in reportbuilder.
    2). Print to file, as PDF.
    3). Save it.
    4). Browse to the file, and open in Adobe Reader 8.
    5). Press the send email button, and make sure that Windows mail is OPEN and
    running in the background.
    6). Notice that an email window opens with the report attached using the
    installed WindowsMail.
    7). You then send it, and it WORKS .. in spite of the email client being
    open in the background.

    Assumption .. maybe it isn't Microsoft after all?
    Thanks

    Adrian Wreyford
  • edited October 2008
    Adrian,

    Please either post a question to the newsgroups or send it to the support
    email, not both.

    Unfortunately there is no way for us to know how Adobe interacts with
    Outlook. They may not be using MAPI or they may be using Extended MAPI
    which we (and Delphi) do not support. As you can see from the following
    link, this is an open issue with Windows Vista that has not been resolved.

    http://www.eggheadcafe.com/software/aspnet/29584579/mapisendmail-code-2-mapi.aspx

    We will continue to keep our eyes and ears open in hope of a fix from
    Microsoft.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2008

  • edited October 2008

    Extended Mapi support is feataure we would like to add to a future release.
    I have done some research on Extended Mapi. It is quite complex. I think
    there are one or more Delphi 3rd party libraries that developers can
    purchase, but for a product like RB, that is not an option for us.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2008
    See this link .. perhaps it explains some issues:
    http://support.microsoft.com/kb/930279

    How about using: ShellExec?

    Regards

    Adrian
  • edited October 2008
    > See this link .. perhaps it explains some issues:

    The article describes an issue with the MAPIFindNext function. We are not
    using that function. We are using MapiLogon, MapiSendMail, and MapiLogoff.
    But perhaps there

    The bottom of the article says "to work around this problem, use the Windows
    Mail API'.

    The Email architecture in RB supports SMTP plug-ins to enable many libraries
    to be used to send email. The default plug-in is the MAPI plug-in. MAPI is
    desierable for invoking the default email client the user has configured for
    the machine: Outlook, Outlook Express/WindowsMail, Thunderbird, etc.

    We also include plug-ins for Indy, Synapse, and Outlook.

    After reading that article, I am thinking that a WindowsMail plug-in could
    also be created.

    You mention ShellExec. I doubt that it has a strong enough API to support
    the required functionality. But if it does, then a ShellExec plug-in could
    be created. See ppSMTPCustom.pas for the ancestor and ppSMTPMapi,
    ppSMTPIndy, etc. for the plug-in descendants.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2008
    Nard Moseley (Digital Metaphors) wrote:
    Just a thought, as I have had a problem with MapiSendMail recently as
    well. I know that MapiSendMail changes the current directory so if after
    sending an email you save anything to a file without using the full path
    it lacks the write rights.


    AFAIK the ShellExec email is very restricted in Vista.

    Kind regards,
    Michal R. Hoffmann
  • edited December 2008
    Any chance of creating the WindowsMail plugin?

    Thanks

    Adrian
This discussion has been closed.