I'd love to see more examples. Specifically, receiving email in the same manner as the 'Send Email' example. Zipping Files would be nice too. Do you have a place where the we could share our examples?
I have code that reads emails via IMAP, but I'm having a heckuva time writing the code that would send a multi-part MIME email for sending attachments.
I've worked up to the point where I need to tell the code where the file should come from, and I'm not sure how to get it to be part of the email... any thoughts or examples on this one?
You guys have been a huge help... hoping you've got one more trick up your sleeve for this one.
We've been using PHPMailer to send email. It includes functions for sending attachments as well as many other features. You can get more info here: http://phpmailer.codeworxtech.com/.
I created a testbed file with an example that you can download here: http://www.scodigo.com/downloads/smartpill/misc/PHPMailer_Example.zip. In this example, I combined both the SMTP and PHPMailer classes together so that no include files are required. I also made a change how the localization is handled for different languages because this was another place where includes were used. If you scroll to the very bottom of the code, you'll see where I'm specifying the from, to, body, attachment, etc.
I also created a file named class.smtp_phpmailer.php that could be installed on your local machine and then you could simply use PHP's include function to include the file. The drawback to include files is of course that they have to be installed and maintained on each machine.
The Testbed_Oct_07 file includes a very basic example that reads the contents of a .mac account INBOX. More info on the imap functions can be found here: http://www.php.net/imap.
We're also working on a new addition to our site that will be named "Code Exchange". The idea is to provide a place where code examples can be shared. We'll be sure to stock it with many good examples when it's released.
I don't have any existing examples so I've started looking into this a bit. I do have an example of using https and I think it's going to be possible to do ldaps. I've got it on my list to investigate and will post more ASAP.
This is something we worked hard to figure out for our upcoming 2.0 version. The hard part was figuring out how to get OpenLDAP to look in a non-standard location for the ldap.conf file. The standard location is different for each platform and would be a pain for people to manage. In the end we managed to get the LDAP module to look in the PHP Support folder for the ldap.conf file.
OK, so why is this important? Well, in order to do LDAPS, you need to have the following line in the config file:
TLS_REQCERT never
(this is the easiest thing to do but if you want to use a cert, the config file allows for that as well but I'm not going to get into how that's done here)
So, create a file named ldap.conf, add the above line and put the file in the PHP Support folder (which goes inside the Extensions folder where the plug-in is installed). You can also write a quick bit of PHP code to automatically create the file.
Please give it a try and let me know how it works for you.
It worked!
Micah,
The LDAPS query worked! Thanks so much for your help. I'll be purchasing this version of the plug-in as soon as I get back to work on this project.
Steve
email examples...
I have code that reads emails via IMAP, but I'm having a heckuva time writing the code that would send a multi-part MIME email for sending attachments.
I've worked up to the point where I need to tell the code where the file should come from, and I'm not sure how to get it to be part of the email... any thoughts or examples on this one?
You guys have been a huge help... hoping you've got one more trick up your sleeve for this one.
;-)
bill
PHPMailer example
Hello Bill,
We've been using PHPMailer to send email. It includes functions for sending attachments as well as many other features. You can get more info here: http://phpmailer.codeworxtech.com/.
I created a testbed file with an example that you can download here: http://www.scodigo.com/downloads/smartpill/misc/PHPMailer_Example.zip. In this example, I combined both the SMTP and PHPMailer classes together so that no include files are required. I also made a change how the localization is handled for different languages because this was another place where includes were used. If you scroll to the very bottom of the code, you'll see where I'm specifying the from, to, body, attachment, etc.
I also created a file named class.smtp_phpmailer.php that could be installed on your local machine and then you could simply use PHP's include function to include the file. The drawback to include files is of course that they have to be installed and maintained on each machine.
Hope this helps.
Regards,
Micah
More Examples...
Hello Hal,
We have a collection of example files here:
http://www.scodigo.com/downloads/smartpill/misc/SmartPill_Example_Files.zip
The Testbed_Oct_07 file includes a very basic example that reads the contents of a .mac account INBOX. More info on the imap functions can be found here: http://www.php.net/imap.
There's also an article regarding email by FileMaker Magazine here: http://www.filemakermagazine.com/videos/pulling-email-into-filemaker-pro.html.
If you do a search on Brian Dunning's custom functions for "PHP" you'll also find a number of custom functions developed specifically for SmartPill: http://www.briandunning.com/filemaker-custom-functions.
We're also working on a new addition to our site that will be named "Code Exchange". The idea is to provide a place where code examples can be shared. We'll be sure to stock it with many good examples when it's released.
Regards,
Micah
LDAP query
Hi Micah,
Great work with SmartPill!
I'd be keenly interested in a secure LDAP query example.
Regards,
Steve
LDAPS
Hello Steve,
I don't have any existing examples so I've started looking into this a bit. I do have an example of using https and I think it's going to be possible to do ldaps. I've got it on my list to investigate and will post more ASAP.
Regards,
Micah
Secure LDAP lookups?
Hi Micah,
Any news on this front. If we could query our LDAP directory over SSL and import that data into Filemaker, you'd have some grateful customers forever!
Thanks,
Steve
Good news!
Hello Steve,
This is something we worked hard to figure out for our upcoming 2.0 version. The hard part was figuring out how to get OpenLDAP to look in a non-standard location for the ldap.conf file. The standard location is different for each platform and would be a pain for people to manage. In the end we managed to get the LDAP module to look in the PHP Support folder for the ldap.conf file.
OK, so why is this important? Well, in order to do LDAPS, you need to have the following line in the config file:
TLS_REQCERT never
(this is the easiest thing to do but if you want to use a cert, the config file allows for that as well but I'm not going to get into how that's done here)
So, create a file named ldap.conf, add the above line and put the file in the PHP Support folder (which goes inside the Extensions folder where the plug-in is installed). You can also write a quick bit of PHP code to automatically create the file.
Please give it a try and let me know how it works for you.
You'll need the latest beta version:
http://www.scodigo.com/downloads/smartpill/beta/SP_PHP_BETA_200b2_Intel.zip
http://www.scodigo.com/downloads/smartpill/beta/SP_PHP_BETA_200b2_Win.zip
And the beta license key:
Name: Beta Tester
Company: Beta
License Key: CGZZQL-9V1OZZ-ZIR3UZ-PJ1401-01004F-6A3201
Regards,
Micah