Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

EmailQuickSend doesn't return an error, but doesn't send e-mail

Featured Replies

Hi folks,

 

I'm new to 360Works Email plugin and I suspect this is a simple one.

 

I'm building a help desk ticketing system and am working on a script that a) reads incoming e-mail requests for support and B) sends an e-mail back confirming receipt and assigning a ticket number.  It is the step that sends the e-mail out that I'm having trouble with.

 

The script step (below) that is intended to send a simple e-mail using EmailQuickSend.  The variable $SendResult receives a 0 upon completion, but no e-mail actually goes out.  I'm testing for "error" in $SendResult, but the 360Works documentation suggests that I should receive a 1 if the function completes successfully.  Is the 0 I'm receiving significant?  Do I need to test for 0 as well as "error" to cover all the bases? And, most importantly, any ideas why the e-mail wouldn't be going out?  

 

I'm using FM Server 11 with IWP on a MacMini running OS X 10.6.8 with Apple Mail 4.6 as the email client.  While the in box of the Mail client successfully gets incoming e-mail (which my script successfully reads), no outbound messages appear in the Outbox or as Sent.

 

Thanks for any help you can provide.

CEATH Company

 

Script step that returns 0 but sends no e-mail:

 

 

EmailConnectIMAP( Mailboxes::MailServer ; Mailboxes::MailBox ; Mailboxes::MailBox_Password ) and
EmailQuickSend (
    Mailboxes::MailBox ;  // from address
    Responses::From;      // to address (original from address of sender)
    Responses::Subject & " <*" & Responses::Key_Field & "*>" ;  // original subject plus ticket number
    "Thank you for contacting us.  Your ticket has been assigned number " & Responses::Key_Field
) and
EmailDisconnect

The first thing I should mention here is that you'll want to use the EmailConnectSMTP (as opposed to EmailConnectIMAP) to send an email message.  This function call will establish a connection to your SMTP mail server (for sending messages) and from there you can send a message.

 

When you call multiple functions together in a single Set Variable script step using the logical "and" operator, FileMaker will return 1 if all conditions return true and 0 otherwise (even if one of the functions returns "ERROR").  This indicates that one or more of the conditions have failed.  A better approach for error checking is to separate each of these function calls into separate script steps and check for an error after each function call:

 

Set Variable[$result; Value:EmailConnectSMTP( "yourMailHost" ; {optional parameters} )

If[$result = "ERROR"]

     // Handle accordingly

     // Can use EmailLastError here to return a more descriptive error message

End If

 

This can be long but it is the best way to check for errors in the function calls.  

 

Another option is to use one of the sample files that comes with the plugin download to test the connection to the server.  You can either use the file itself (the EmailClient.fp7 has an SSL option built into the UI) or you could even use the data viewer to test the connection.  The plugin function will return "1" if the call is successful.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.