Problem with email
Using D2007, Vista, Office 2007 (Outlook MAPI client)
I have tried to use MAPI and also Indy to send a report from the previewer,
but with no luck.
When using Indy my code is
TppSMTPPlugIn.RegisterClass(TppSMTPIndy);
ppReport1.EmailSettings.PreviewInEmailClient := False;
ppReport1.EmailSettings.ShowEmailDialog := True;
ppReport1.EmailSettings.HostAddress := TeamsterDM.MailServer.Host;
ppReport1.EmailSettings.UserName := TeamsterDM.MailServer.UserName;
ppReport1.EmailSettings.Password := TeamsterDM.MailServer.Password;
when using MAPI
ppReport1.EmailSettings.PreviewInEmailClient := True;
ppReport1.EmailSettings.ShowEmailDialog := False;
either way the build dialog shows, but it doesn't go any further.
Any ideas?
Thanks
I have tried to use MAPI and also Indy to send a report from the previewer,
but with no luck.
When using Indy my code is
TppSMTPPlugIn.RegisterClass(TppSMTPIndy);
ppReport1.EmailSettings.PreviewInEmailClient := False;
ppReport1.EmailSettings.ShowEmailDialog := True;
ppReport1.EmailSettings.HostAddress := TeamsterDM.MailServer.Host;
ppReport1.EmailSettings.UserName := TeamsterDM.MailServer.UserName;
ppReport1.EmailSettings.Password := TeamsterDM.MailServer.Password;
when using MAPI
ppReport1.EmailSettings.PreviewInEmailClient := True;
ppReport1.EmailSettings.ShowEmailDialog := False;
either way the build dialog shows, but it doesn't go any further.
Any ideas?
Thanks
This discussion has been closed.
Comments
I'm a bit unclear what you mean by this. Are you receiving a build error?
Is your application actually compiling successfully?
Note that in Vista, Outlook must be closed for the window to successfully
pop up using MAPI.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
no, I don't receive an error. The application compiles and runs without a
proble. The report is created and displays in the preview window, from wheer
it can be printed. However, when you click on the send email button, the
report builds the pdf, but after the progress/cancel dialog closes nothing
else happens, in MAPI. When I choose to display the EmailDialog, this
displays and when I click send nothing happens.
Actually looking further, I am not sure that it creates the pdf. The target
folder is current users AppData\Local\Temp, but even when I uncjeck the
delete file box it doesn't seem to be there.
Is there an event where I can take over this? Ideally, I'd like it to
produce the pdf and then call an event so I can handle the whole email
operation in code.
Are you certain Outlook is closed when trying to email your report? Try
running Demo 110 located in the \RBuilder\Demos\1. Reports\... directory and
see if that successfully emails the report. In my quick testing this worked
with Outlook.
If you would like to take control over the email procedure, I would first
suggest using the Indy plugin rather that the Mapi one. This will create
the PDF and send the email directly using a specified email server behind
the scenes (no email client involved).
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com