Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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
Posted

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.

This topic is 4344 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.