I have this client that requieres that a report being previewed in the screen to be sent via email using her Outlook program.
I know there is a number of templates with emailing capabilities, I just wanted to know your thoughts, comments or reccomendatios about what are you using to do the same or similar task.
To send via Outlook you need MAPI, not sure what template implement that. Most send direct via SMTP. Thats what I do.
Having said that the landscape has changed a little and Office365 is all cloud, so that makes it a little harder. I know nettalk does OAUTH that you now need to talk to most cloud things. But beyond that I donât know.
I use the Clarion ClaTalk.SendMail method that uses the ClaRunExt.DLL.
I let the user view the report (e.g. a client invoice). I have a Clarion form that has the email fields to send it as an attachment to the client. The message can be modified before it is sent, or it doesnât have to be sent. (One button creates the report and opens the form).
I put the sender as a cc, so they get a copy, which can be received in Outlook or whatever the user has.
This program is run from a Windows Server computer, so I donât need to have Outlook or any other email program installed on the server. Iâm using Clarion 11 and the wPDFControl template from Klarisoft to create PDF reports.
Another example is emailing paystubs to employees. Since they have direct deposit, this lets them get an email with their PDF paystub as an attachment. The program sends each employee their own paystub, so of course the program creates a separate email and report file for each employee. A cc for each email is sent to the payroll admin. In this case, each paystub is not previewed before sending.
In my application, I have an Email Log file, which of course keeps track of the emails that are sent, to whom, subject line, client name, and company. So in the application, the user can see the emails that are sent to a client when viewing the company record, so the user doesnât have to go to Outlook to see it. The emails are ccâd to the user so they get to see them in Outlook too.
We use Nettalk with ChromeExplorer and Secwin 7 (NOTE I do not work for Capesoft . Display email in HTML before send. After send we log and save the full email in SQL table.
Works very good for us. Thus way we can see all emails and manage who can resend and or view send emails attached to that person or client.
I have been using a Softmasterâs Office Integration for many years. Works really well.
You can send the emails âblindâ, meaning Outlook is not opened in the screen, yet the emails sits in the Sent Items folder.
Normally . . . when you send an EMail you also explain what itâs for, or about . . .just attach the .pdf to the EMail and create a short mesage to explain the .pdf and why you sent it.
Iâve been researching some of the answers based on feasibility, ease, and price.
And after reading some information pages, I found an easy and free solution: the Outlook command line.
Using the RUN() command, I just call outlook and pass it the parameters I need: email, subject, body, and the attached file.
And it looks like this:
!LOC:OutlookCommand is a local variable to store all the string that is passed to the RUN() command.
!GLO:Outlook is the path where outlook is installed. It can be empty if Windows finds the path automatically.
!CLI:Email is the client email (string)
!GLO:Subject is the email's subject (string)
!GLOBody is the email's body (string)
!Glo:Path is the path to the attachment file
LOC:OutlookCommand = Clip(GLO:Outlook)&' /c ipm.note /m "'&Clip(CLI:Email)&'?subject='&Clip(GLO:Subject)&'&body='&Clip(GLO:Body) &GLO:Path
RUN(LOC:OutlookCommand)
When executed, Outlook opens and it gets automatically pre-popullated, so the user can change anything before sending it and once sent, the email is stored in the SENT folder.
Thank you all guys for all your suggestions. They all helped me find this one.
You can actually do that if you use MapiSendMail and then it will work like you describe with what ever their local Email client is. The key is it needs to be a local mail client, not web-mail.
This would be the complete line command without Clarion variables:
LOC:ComandOutlook = 'C:\Program Files\Microsoft Office\Office16\OUTLOOK.EXE /c ipm.note /m "'[email protected]'?subject=Meeting tomorrow&body=Hey team, remember that we have an a team chat tomorrow at ClarionHub.com" /a "C:\path\to\file.pdf"')
RUN(LOC:ComandOutlook)
Just replace all the variables needed and, specially, respect the "
Actually, you can send a lot of switches. Check this page out for the full list of them:
We have had a similar requirement. The user sending the e-mail needed to,
See the e-mail in their sent folder.
Be able to ADD other attachments, if and when needed, BEFORE sending.
Solution that has worked for the last 12 years, irrespective of version of MS outlook.
HTML template file
VBS script
Process:
Load the HTML template file into StringTheory aka âstâ
Replace /populate the variables using the st object.
a. Your Ticket number: %ticketno% - st.replace(â%ticketno%â, âSharkDrive1212â)
Write the HTML file to a temp folder. (Our app installation always creates âc:\temp\PDFsâ)
a. St.savefile(âc:\temp\PDFs\TMP_QWQWQWGUID.HTMLâ)
Execute the EMAIL.VBS script from the Clarion App with the needed parameters.
Result: Outlook opens up with a NEW email that was created and the âTMP_QWQWQWGUID.HTMLâ file becomes the actual body of the e-mail.
All the user has to do is click SEND.
This approach was chosen because the user could verify that they are actually sending the correct type of information, aka template, to the recipient.
The RUN() command is used.
(PS! Before StringTheory the RTF class was used to find and replace variables)
Sorry, I cannot get it working. The last part (âŚâ&â /a '&GLO:Path) throws errors.
I removed the â before the & (in â&â) and can compile, but there is no attachment in the email
Hope you can help