Difference between revisions of "EmailPlugin"

From 360Works Product Documentation Wiki
Jump to navigation Jump to search
Line 47: Line 47:
 
The email plugin allows you to include HTML formatting, inline attachments, and multiple attachments per email. Additionally, it is capable of receiving email via IMAP/POP and send SMS text messages to phone numbers United States, all from your FileMaker solution. This section will show how you can send emails with HTML content and inline attachments with ease.  
 
The email plugin allows you to include HTML formatting, inline attachments, and multiple attachments per email. Additionally, it is capable of receiving email via IMAP/POP and send SMS text messages to phone numbers United States, all from your FileMaker solution. This section will show how you can send emails with HTML content and inline attachments with ease.  
  
The email plugin example file provides a simple form layout to test the sending and receiving. Select ‘Demo Examples’ in the left panel, and select the tab ‘Send HTML Email’.  </br>
+
The email plugin example file provides a simple form layout to test the sending and receiving. Select ‘Demo Examples’ in the left panel, and select the tab ‘Send HTML Email’.   
[[File:emailplugindemofile.jpg]]
+
[[File:Emailplugindemofile.jpg]]
 
 
  
 
==Lower the chances of your email being identified as spam==
 
==Lower the chances of your email being identified as spam==

Revision as of 17:01, 8 February 2016

The email plugin page is here: http://360works.com/email-plugin/
Plugin documentation page: http://static.360works.com/plugins/EMAILPLUG/documentation.html

Troubleshooting

Too many errors on this connection

Some mail servers (typically IIS) have a configuration setting for how many messages can be sent across a single session. To solve this issue:

  • Close the connection at the end of the loop, and re-open it at the beginning. This will slow down sending significantly, but is probably the easiest way to fix the problem
  • Configure your SMTP server to remove any limitations on maximum number of messages, maximum message size, maximum number of failures allowed per connection. This might only be an option if you're hosting your own SMTP server
  • Switch to a different SMTP server that has no limits on number of messages you can send.

EmailSend error: "Invalid Addresses"

It appears there is an issue sending messages using the plugin with some OS X. The EmailConnect works fine as do many of the other functions. But the EmailSend function returns the "Invalid Address(es)" error. The stack trace shows the following exception:

SMTPAddressFailedException: 504 5.5.2 <10.0.1.13>: Helo command rejected: need fully-qualified hostname

This is due to the spam settings on the mail server. A fix can be found here:

http://support.apple.com/kb/TS3023

EmailConnectX method error: "PKIX path building failed"

This error can occur when the underlying Java process for the Email plugin cannot establish a "secure" connection to the given mail server. This error can occur even if the mail server does not require any kind of secure connection such as SSL or TLS.

The Avast! antivirus Mail Shield can cause this error, so disable Mail Shield if you have Avast! antivirus installed.

There is a special parameter that can be passed to the EmailConnectX method (EmailConnectIMAP, EmailConnectSMTP, etc.) that will force the Java process to trust the connection it makes without regard to any warning/error messages. Pass an additional parameter to the EmailConnectX method of "forceTrust=true" to force the process to ignore an unverifiable connection. E.g., EmailConnectIMAP( "mail.server.com" ; "myUsername" ; "myPassword" ; "forceTrust=true" )

We strongly recommend you verify the IP address or DNS name of the mail server to ensure that you are connecting to the proper machine!

Downloaded emails are not decoded properly

When emails are decoded improperly, the resulting email body may either appear to be a very long string of various text characters or it may contain equals signs ("=") scattered throughout. Either of these issues is due to a decoding error where the machine running the plugin lacks the libraries required to decode the email properly.

v2.12 of the Email plugin incorporates a fix for this issue. Pass an additional parameter of "alternateDecoding=1" to the EmailReadMessages function to enable an alternate decoding method. Please contact support@360works.com for additional support regarding this issue.

Text justification issues in HTML

FileMaker's GetAsCSS function combines the <div> and <span> tags when it converts formatted text to HTML. This can cause spacing issues in the resulting HTML code due to how each tag is treated as a different kind of element (block vs inline). Most text ends up with a <span> tag which is treated as an inline element, and inline HTML elements do not treat spacing or text-justification in a common-sense manner when combined with the <div> tag. You can fix most spacing issues you may run into by adding the following HTML code to the email header

<style>span {display: block;} </style>


Guidelines

Overview: Adding HTML with Inline Attachments

You can natively send plain text emails using the Send Mail script step in FileMaker, but what about emails that you need to be more graphically appealing? This is where 360Works Email Plugin meets a mission critical need by extending FileMaker’s existing email functionality, allowing you to send better email.

The email plugin allows you to include HTML formatting, inline attachments, and multiple attachments per email. Additionally, it is capable of receiving email via IMAP/POP and send SMS text messages to phone numbers United States, all from your FileMaker solution. This section will show how you can send emails with HTML content and inline attachments with ease.

The email plugin example file provides a simple form layout to test the sending and receiving. Select ‘Demo Examples’ in the left panel, and select the tab ‘Send HTML Email’. File:Emailplugindemofile.jpg

Lower the chances of your email being identified as spam

Spam filters assign each incoming email a spam "score" that indicates the likelihood that the email is in fact spam. One flag that significantly increases the spam score of an email is if the "from" address is an email address only without a corresponding name (e.g., 360works@email.com). In order to avoid triggering this flag, you should add a name to your "from" address and put the email address in brackets following the name (e.g., 360Works <360works@email.com>). Please see the Internet Message Format RFC 2822 for more details

FileMaker's GetAsCSS function

GetAsCSS will take formatted FileMaker text and return HTML code that reproduces the formatted text in a form suitable for an HTML email. Use this to take bold, underlined, and even colored text from FileMaker to your HTML emails.

GetAsCSS also alters any HTML code in a FileMaker text field to be represented as plain-text in an HTML email. So if you have a formatted text field that also contains an HTML hyperlink (<a>), calling GetAsCSS will return the formatted text but it will change the HTML hyperlink into plain-text. This is because GetAsCSS alters the special characters (such as angle brackets and double-quotes) used to identify HTML code into their character entity equivalents. For example:

< becomes &lt;
> becomes &gt;
" becomes &quot;

If you must combine HTML code with formatted FileMaker text, you will need to call the Substitute function on the resulting text several times to replace the altered HTML special characters with their actual characters. For example:

Let(
[
text = GetAsCSS("<b>Formatted</b> text is the way to go! <a href=\"http://www.360works.com\">360Works!</a>");
first = Substitute(text ; "&lt;" ; "<" );
second = Substitute(first ; "&gt;" ; ">" );
final = Substitute(second ; "&quot;" ; "\"" )
];
final
)

POP mail server notes

POP (Post Office Protocol) mail servers are different from IMAP (Internet Message Access Protocol) mail servers in many ways, but one of the most important differences is that POP mail accounts only have a single folder: the Inbox.

POP mail servers keep only a single copy of each email on the mail server. You cannot create additional folders, and you cannot move emails around on the mail server since there is only one place (the Inbox) for them to go. However, using a mail client (e.g., Thunderbird, Mail.app, or PostBox) to interact with a POP mail server gives the illusion that you can create folders on the mail server. In fact, you are only creating local folders that the mail client itself uses to store the emails.

If you were to create a folder in a mail client while connected with a POP mailbox and move emails into that folder from the Inbox, you are actually removing the emails from the mail server and storing them locally (and only locally!) into the folder in the mail client. This removes the emails from the mail server which makes it impossible to retrieve them with the Email plugin, so be sure you are aware of how emails are stored if you work with a POP mailbox.

Read Receipts

Read receipts allow a user to confirm when the email has been read by the recipient(s). The Email standard defines a header called 'Disposition-Notification-To' which specifies the address to which read receipts should be sent. You can set this header using the EmailSetHeader function. For example, to send a read receipt to "address@hostname.com", you would call EmailSetHeader( "Disposition-Notification-To" ; "address@hostname.com" ). Whether or not this read receipt actually gets delivered is entirely dependent on the recipient's mail client. Some clients, such as Apple Mail or Gmail, don't support read receipts at all. Others, such as Google Apps (Google's online business suite) or Thunderbird, will offer a user the option to send the receipt or not. Therefore, not receiving a read receipt is not a guarantee that the message hasn't been read.

If you wish to implement sending read receipts with our plugin, simply check the header using EmailReadMessageValue("Disposition-Notification-To") when reading in emails. If the sender is requesting a read receipt, this function will return the desired address.