To export and attach the email, just script a variable and attach the variable in the "attachment" section of the send mail script step.
Set Variable [ $file ; get(temporarypath) & getAsText(table::container) ]
Export Field Contents [ table::container ; $file ]
(specify "$file" in your attachment box in the send mail step)
Also in the send mail script step you can calculate the text that appears in the subject and body lines of the email.
Also, if you want multiple email addresses, than you can calculate it separated by semicolons or commas, like so:
table::email1 & ";" & table::email2 etc..
Lastly, make sure to choose "email client" from the send email script step so it opens the email with the default email client, and also UNcheck the "perform without dialog" option to make sure that it brings the email up before it is sent.
You can script all of this. Your script would need at least the following steps:
• Set Variable—here you would define a path for the exported pdf, probably utilising Get(TemporaryPath)
• Export Field Contents—to actually export the PDF using the variable specified above as the export path
• Send Mail—where you can specify all the components of the email: To/CC/Bcc/Subject/Message/Attachment
A couple of notes re the above:
1. Using Temporary Path means that you don't end up with extraneous copies of the PDF outside of your database, because FM creates and then destroys the temp version when it no longer requires it
2. With the provisos you have of alternate addresses etc, you might want to leave the perform without dialog option unchecked in the Send Mail step, so that you can tweak the email case by case.
3. The choice of From address is more likely controlled by your email program rather than FM, but you might be able to manage that via a calc.
thank you so much guys.