Jump to content

Email scripts with IWP


cvincent
 Share

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

Recommended Posts

Sending emails with Instant Web Publishing and FileMaker Server Advanced.

This will open the user's email client, which has to be properly configured to work. The syntax for the URL is:

"mailto:" & EmailAddressTextField & "?Subject=" &

Substitute ( Substitute (

SubjectLineTextFieldName

; "?" ; "--QuestionMark--" ); "&"; "--Ampersand--") &

"&Body=" &

Substitute ( Substitute (

BodyTextFieldName & ""

; "?" ; "--QuestionMark--" ); "&"; "--Ampersand--")

The fields SubjectLineTextFieldName and BodyTextFieldName CANNOT contain a question mark or ampersand, so the substitute functions replace them with the text:

--QuestionMark-- and --Ampersand--.

EmailAddressTextField must contain a valid email address like [email protected]

The mailto: command will not be affected by pop-up blocking since it uses a different protocol then https and http which are passed to a web browser.

Normailly the mailto: is passed to Mail.app, OS X can also be configured to open Entourage, Outlook etc…as the email application.

You can also use PHP here is an example I created:

http://www.fmwebschool.com/resources/IWP_Email.zip

In Kindness

Stephen Knight

http://www.fmwebschool.com

Link to comment
Share on other sites

  • 5 months later...

I like where this script is going but I think it's a bit better to substitute encoded special characters instead of substituting text. Just like %20 is a URL-encoded space, use %26 for ampersand and %3F for question marks. Also, substitute carriage returns (paragraph symbols) with %0A. YMMV, but %0A gets me a new line and a line break. If %0A doesn't work, try %0D or %0A%0D. (Reference)

Try this script instead:

Open URL [No dialog; 

"mailto:" & Database::Email & 

"?Subject=Sample%20Subject%20" & 

"&Body=" &

Substitute (Substitute ( Substitute (

Database::EmailMessage; "?" ; "%3F" )

; "&"; "%26")

; "PP (paragraph symbol)"; "%0A")]

Edited by Guest
Link to comment
Share on other sites

  • 1 year later...

This topic is 5230 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
 Share

×
×
  • Create New...

Important Information

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