Jump to content

Send HTML Email through Outlook


This topic is 3162 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Requirements:

ScriptMaster for FMP (AWESOME!)

Install Groovy and Reboot (yes you have to reboot, the ActiveXProxy won't work without it)

(During setup ActiveXProxy is an option, make sure it installs with Groovy.)

Recommended:

Install Advanced Security for Outlook

Should be in a startup script: (if this runs more than once, it stops working!)


SMLoadJar ( "file://C:/Program Files/Groovy/lib/scriptom-1.2.jar" ) & 

SMLoadJar ( "file://C:/Program Files/Groovy/lib/jacob.jar" )





Setup the variables for the message:



/* you can use multiple addresses seperated by ';' */

SMSetVariable ( "eTO" ; "[email protected]" ) & 

SMSetVariable ( "eSUBJ" ; "The thing" ) & 

SMSetVariable ( "eBODY" ; "You know, the thing." )







EvaluateGroovy ( "

	import org.codehaus.groovy.scriptom.ActiveXProxy;

	

	// Create the Outlook Object

	def oOutlook = new ActiveXProxy("Outlook.Application");

	

	//Create the MAPI namespace object and logon

	def oNS = oOutlook.GetNamespace("MAPI");

	oNS.Logon "Outlook";

	

	//Create the Email Item

	def oEmail = oOutlook.CreateItem(0);

	

	//Apply the Properties	

	oEmail.Recipients.Add eTO;

	oEmail.Recipients.ResolveAll

	oEmail.Subject = eSUBJ;

	oEmail.HTMLBody = eBODY;

	

	//Display the Email

	oEmail.Display "";

" )

Edited by Guest
Link to comment
Share on other sites

  • 1 month later...

Hello Alex,

Thank for your information. "Download Click Yes"? What do you mean by that? I am sorry that I got lost. However, I found one of member writing VB Script to bypass the security outlook warning directly (the program that I want to make is full automation without any kind of user interface).

I am wondering if you know how to get the filename on a folder by their creation date. For example, today, I would create 10 filenames. I want VB Script to throw their filepath names (the 10 filenames) to Filemaker to process them to database. Tomorrow, I would have 5 filenames, then I would read only the 5 rest filenames and not the 15 filenames (10 filenames plus 5 filenames). Is that possible?

Thank you.

Link to comment
Share on other sites

Hello James,

Sorry for the misunderstanding. I am asking about this message below... (from my previous question)

I am wondering if you know how to get the filename on a folder by their creation date. For example, today, I would create 10 filenames. I want VB Script to throw their filepath names (the 10 filenames) to Filemaker to process them to database. Tomorrow, I would have 5 filenames, then I would read only the 5 rest filenames and not the 15 filenames (10 filenames plus 5 filenames). Is that possible?

About bypassing the security warning outlook, Alex (Genx) mentioned to download Click Yes and actually I found out one member, if not mistaken aholtzapfel, that wrote VB Script that can bypass the security warning.

Happy holidays...

Link to comment
Share on other sites

That would be a groovy script. And Scriptmaster will run them... Sometimes you have to modify them, but you should be able to do that. Go to the Groovy website and look over the tutorials.

Link to comment
Share on other sites

I do alot of AutoIT programming. I love it! But it doesn't integrate with Filemaker easily.

You can use the ActiveXProxy in groovy with Scriptmaster to access the AutoITX object but it seems a bit silly to me, since groovy will do so much.

Link to comment
Share on other sites

My point is that I can use AutoITX with Filemaker, but I would have to use Scriptmaster and Groovy's ActiveXProxy to do it. If I can accomplish my objective in Scriptmaster/Groovy (no ActiveXProxy and AutoITX) without the extra step, I'm going to do that. It is also important to note that AutoITX doesn't fully implement AutoIT.

I suppose that one could use Scriptmaster to call an AutoIT executable that would pass back a result through the errorlevel environment variable. I imagine that Groovy is capable of interacting with environment variables.

Link to comment
Share on other sites

You might want to take a look at the Scodigo PHP plugin - then you can send whatever email you want without even needing outlook... not to mention do lots of other cool stuff.

Solutions like that have merit. I wanted an Outlook solution because in my small office, we use Outlook/IMAP to track all our email. To my dismay, all our email correspondence is HTML. So, emails based on FMP information have involved Word mail merge and CSV export files. This gets pretty ridiculous when you start adding attachments, as I have found no way to do this from Word mail merge. Unlike a PHP or server-based solution (if I am not mistaken,) a solution like this one allows FMP to send HTML email through Outlook. Tracking remains in the email client where our office manages the all of the email.

I could have used this on a project about a year ago, it would have saved me a good bit of time.

Link to comment
Share on other sites

  • Newbies

Hi. I am setting up an XP machine for FM Pro.

The FM guy has asked me to setup SMTP for FM to be able to send notifications to the administrator in the even of a problem. Can this be done through the default outlook client or can I set up SMTP by itself? Thanks for all help.

Link to comment
Share on other sites

Can this be done through the default outlook client or can I set up SMTP by itself? Thanks for all help.

With the PHP solution and / or scodigo plugin you could send through SMTP, with FM by its lonesome, it will use the default mail client on your PC.

Link to comment
Share on other sites

  • 9 months later...
  • Newbies

Jamie,

Coming from a Java web application background, I miss having a testing framework.

I looked into AutoIt and I agree it's poor integrating with Filemaker. So I'm curious how you use groovy to perform tests? I am familiar with Scriptmaster. Being a Groovy newbie, I'm having a mental block envisioning how Groovy can accomplish the same things as AutoIt.

If you could provide an example that would be great!

Thanks!

Link to comment
Share on other sites

  • 8 months later...
  • Newbies

Hi there, filemaker beginner here, i'm developing a solution for a family business, and have produced a new contact management and enquiries solution. I had it all setup but then my employer has requested being able to send html emails via outlook, immediately i paniced until i stumbled across this post via google. It seems like this is exactly what i am looking for.

However i have downloaded scriptmaster and groovy, and managed to find the correct .jar files

SMLoadJar ( "file://C:/Program Files/Groovy/lib/scriptom-1.2.jar" ) &

SMLoadJar ( "file://C:/Program Files/Groovy/lib/jacob.jar"

(this was neccesary as they weren't included in the latest release of groovy. However when running the script i get the following error in the groovy console:

unexpected token: import at line: 10, column: 5

as far as i can tell this is pointing to:

import org.codehaus.groovy.scriptom.ActiveXProxy;

i did some research and it does appear that it has been renamed since this post to activexobject, however this shouldn't be an issue due to using the older .jar files, any help with this matter would be greatly appreciated.

The final solution is that i want a button to press which opens a new message in outlook express, and allows html, as the signature on the emails requires it.

Regards Alex

Link to comment
Share on other sites

  • 1 month later...

I am soooooooo sorry for the delay. I have been somewhat busy. Anyway, I tried the method with the latest version of scriptmaster and I am getting a similar error.

To that end, I recommend that you modify an email script that comes in the SM examples db or purchase the email plugin that 360 offers. If you need to keep copies in a local client, simply BCC the email to the appropriate account.

Sorry that I am not more help than this. :

Link to comment
Share on other sites

  • 1 year later...

Scuse late posting, but really peeps shouldn't think Filemaker on a Mac doesn't have HTML email capacity, we've been enjoying it (with help of Applescript & XMail) since 2005ish.

http://fmforums.com/forum/showtopic.php?tid/217843/

possible on Mac OS X for free, utilizes XMail osax. Very effective. Been using for years, but only now bothered to start contributing to community, and indirectly i'm hoping some of you will donate to JB LeStang, to encourage freeware/donationware developers.

V reliable... + automatable attachments etc.

I hope my demo is clear enough to follow!

Link to comment
Share on other sites

  • 3 years later...

When I try and "OK" the specift calculation dialog box for this step:

 

EvaluateGroovy ( "
    import org.codehaus.groovy.scriptom.ActiveXProxy;
    
    // Create the Outlook Object
    def oOutlook = new ActiveXProxy("
Outlook.Application");
    
    //Create the MAPI namespace object and logon
    def oNS = oOutlook.GetNamespace("
MAPI");
    oNS.Logon "
Outlook";
    
    //Create the Email Item
    def oEmail = oOutlook.CreateItem(0);
    
    //Apply the Properties    
    oEmail.Recipients.Add eTO;
    oEmail.Recipients.ResolveAll
    oEmail.Subject = eSUBJ;
    oEmail.HTMLBody = eBODY;
    
    //Display the Email
    oEmail.Display "";
"
)

 

I get an error message saying "The specified table cannot be found" for "Outlook.Application"

 

 

Please help!

Link to comment
Share on other sites

  • 1 year later...
  • Newbies

Hello,

the thread might be very old and obsolete for the last contributor now, I'm nevertheless posting the solution that solved the strange problems for me.

  1. use ActiveXObject instead of ActiveXProxy in the current version of scriptom (1.6) - I don't know when the change was carried out. 
  2. Before running the function, you must add two jars to ScriptMaster in a startup script, e.g.
  3. Set Variable $result ; Value:SMLoadJar ( "file://C:/Program Files/Groovy/lib/scriptom-1.6.0.jar" ) & SMLoadJar ( "file://C:/Program Files/Groovy/lib/jacob.1.2.jar" )
    where "C:/Program Files/Groovy/lib/" is the path to the Groovy or load the jar files from a comtainer field from a filemaker table (See 
  4. Assure that the jar files are loaded only once, eg. by checking SMGetLoadedJars for the jar names before loading.

 

Regards

Xanius

Link to comment
Share on other sites

This topic is 3162 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.