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.

Send mail using Found Set and capturing status, MessageID

Featured Replies

Hi

Can anyone send me some examples of Send Mail(SMTP Server) function using Found Set records to populate To, CC, BCC?

Also is there any ways to capture status(Sent, failed,, MessageID) of Send Mail function?

 

Thanks in advance.

H I

Edited by haseebiqbal

You can use a loop to parse through your found set:

Go to record [first]
loop
  send mail
  set variable [$result; Get ( LastError )]
  if [$result<>0]
     perform script ProcessError[$Result]
     endif 
  go to record [next/exit after last]
  end loop

You can get the result of the send mail script step using Get ( Lasterror ) and then action it accordingly. If no errors are returned, the email was send successfully. Any other error you can match up in the help. Filemaker is not very elaborate though.

  • Author

Thanks Olger but canot related your Send Mail function with the attached one. Seems there are version differences.

SendMail_FMPro13.png

MessageID:

Our email server status shows following while send mail from FM Pro

02/09/2015 12:08:22   SMTP Server: PCName????.company.com.au (10.2.2.147) connected
02/09/2015 12:08:22   SMTP Server: Message 000BC0D4 (MessageID: <[email protected]>) received
02/09/2015 12:08:22   SMTP Server: PCName????.company.com.au (10.2.2.147) disconnected. 1 message[s] received

How I can get the above MessageID from FM Pro and record it in table? Dacons Mail.It plugin could retrieve it using its own native function but I cannot use mail.it plugins here for a policy.

Edited by haseebiqbal

Filemaker can't retrieve messageids natively. All FM will tell you (via Get ( LastError ) ) is whether a message was handed off to the configured SMTP server successfully. Even if the message fails after that (ie SMTP server can't deliver the message for some reason).

What Filemaker will tell you is whether the communication between the SMTP server and itself encountered errors or not. Beyond that is not possible. To do that, Filemaker would have to keep the connection open or periodically query the SMTP server. Considering emails can be delayed for days, this would place a significant strain on both servers.

So even if Filemaker reports no error, an email can still fail to be delivered. The SMTP server should return the message to the sender (your from addr) if it is unable to deliver.

  • Author

Thanks Olger

Actually I struggling to populate To, CC & BCC using record set.

My script finds for String "To", "CC", "BCC" then returns record set of emails. What I put in the screenshot is it right?

If you use a script similar to what I've created, then only one field, either to, cc or bcc will be populated depending on what email_to_cc_bcc has.

So if email_to_cc_bcc has "To", then only the to: field will be populated. However, if your email_to_cc_bcc field has "to" in it (notice the case), it does not get populated. In your scenario, you cannot populate all three fields. As long as the email_to_cc_bcc field is in the same table as the records you are looping through, or are accessible through a relation, it should work.

I gather that is not quite what you want, so you'll have to elaborate what it is you are trying to accomplish.

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.