8 Replies Latest reply on Mar 26, 2012 3:57 PM by AlanStirling

    Send email via IWP

    Hudi

      I will be using the Filemaker template "email campaign" to send emails to batches of people (no more than 10 at a time) from IWP. All the users are on the same office network but will be accessing this DB via IWP. Reason for that is they all run on FM 7 and this DB uses features they do not have. Problem is I do not want each user to send emails from his/her own email account but for them to be generated (i.e "from") a specific address.

      I thougt of doing this via SMTP using the following script I found on a different forum.

      Commit Records/Request[]
       Set Error Capture [On]
       Allow User Abort [On]
       If[]
       End If
       Send Mail [Send via SMTP Server; No dialog; To: "any_email_address@email.com";
       message:"Any text here!" & "¶¶" & "field name here: "& database name::field & "¶¶" & "Submitted By: " & Get(AccountName) & "¶¶" &
       Go to Layout [original layout]
      

      would this work? and are there easier ways to do this?

      any input on this matter would be greatly appreciated. I would test this but will only be in the office tomorrow and would like to be as prepared as possible.

       

      thanks !!

        • 1. Re: Send email via IWP
          BowdenData

          brushfire1776 wrote:

           

          ...send emails to batches of people (no more than 10 at a time) from IWP...Problem is I do not want each user to send emails from his/her own email account but for them to be generated (i.e "from") a specific address. I thougt of doing this via SMTP using the following script I found on a different forum.

          Commit Records/Request[]
           Set Error Capture [On]
           Allow User Abort [On]
           If[]
           End If
           Send Mail [Send via SMTP Server; No dialog; To:  "any_email_address@email.com";
           message:"Any text here!" & "¶¶" & "field name here:  "& database name::field & "¶¶" & "Submitted By: " & Get(AccountName) & "¶¶" &
           Go to Layout [original layout]
          

          would this work? and are there easier ways to do this?

          any input on this matter would be greatly appreciated. I would test this but will only be in the office tomorrow and would like to be as prepared as possible.

           

          thanks  !!

           

          Hi,

           

          With IWP, your only option using the built-in email function is to use SMTP. You will see in the email function for SMTP, that you can supply just about all the values (From, To, CC, Subject, Body, etc.) using fixed text or calculated values from the dB. If you don't need for the user to have any interaction with the email, then you don't need to switch layouts. If you want to have them interact with the message, then you will be looking at building some layouts to mimic an email "form". Maybe the template you refer to has this? Depending on other needs, you may need to store the contents of the emails, in which case you would want an EMAIL table and likely want to link an email record to some kind of parent record.

           

          Keep in mind that with SMTP email, there isn't any record kept in the user's regular email system/client. If this is desired, just BCC the desired address so it will show up in their regular email.

           

          If you want more than just the basics (like HTML email and so on), you will need to go with a plugin that is IWP compatible. Not sure at all about the various plugins being IWP compatible though, so do some research as needed.

           

          Feel free to contact me back-channel, as I just recently worked on a system that has an IWP email interface, so I have a good handle on layouts, fonts, message formatting and so forth.

           

          HTH.

           

          Doug de Stwolinska

          Bowden Data Services, LLC

          douglas.destwolinska@yahoo.com

          • 2. Re: Send email via IWP
            Hudi

            Doug,

             

            thank you very much for that awesome response. I've been developing for a little over a year and I am repeatedly shocked at how helpful everyone is on these forums. Seriously, its awesome.

             

            What are your thoughts on using this method.

             

            Open URL ["mailto:"& YourTable::email address& "?Subject = " & YourTable::Subject field &  "&cc=" & YourTable:: Also Send To & "&Body=" & YourTable::Email Body Field]

             

            This opens an email window using the users own email client.I have been looking into it and wanted to get your opinion.

             

            pros- users can modify their emails before they get sent out as well as see it being sent from their own email account.

             

            Cons- Its a hack.

             

            Also, these emails are super simple. just a few sentences each.

             

            Thanks.

            • 3. Re: Send email via IWP
              Malcolm

              What are your thoughts on using this method.

               

               

              Open URL ["mailto:"& YourTable::email address& "?Subject = " & YourTable::Subject field &  "&cc=" & YourTable:: Also Send To & "&Body=" & YourTable::Email Body Field]

               

              There are limits to the amount of data that can be transferred via the URL. If you have FMPro do a safety check to see that the email is within the limits this method is fine.

               

              malcolm

              • 4. Re: Send email via IWP
                BowdenData

                Hi,

                 

                I'll echo Malcolm's comments. You say that the messages are short and so as long as they stay that way, this should work. I recommend using a custom function by Caspar Harmer at Digital Fusion Ltd. It encodes your text to be compliant with the Mailto: format. Link to CF below. In my recent case, the message content was way too long for Mailto and we wanted some formatting (basic spacing type stuff) within the message body, thus the reason to create a mail layout for the users.

                 

                http://www.briandunning.com/cf/525

                 

                Regards,

                Doug

                • 5. Re: Send email via IWP
                  Hudi

                  Sweet. that custom function is really helpful. thanks!

                  • 6. Re: Send email via IWP
                    Hudi

                    Here's what I ended up doing. I have one small issue though. I am working in FM7 and for some reason the carriage returns are not working. The "your password" is next to the body, with not even a space. Any thoughts?

                    "mailto:"& "Campaigns::email"

                    &

                    "?Subject = " & Campaigns_SelectedTemplates::Subject

                    &

                    "&Bcc=" & Campaigns::g_Contact List_Temp

                    &

                    "&Body=" & Campaigns_SelectedTemplates::Body

                    & ¶ &¶ & "¶"  &

                     

                    "Your Password:"   &  Campaigns::password

                    • 7. Re: Send email via IWP
                      BowdenData

                      brushfire1776 wrote:

                       

                      ...for some reason the carriage returns are not working. The "your password" is next to the body, with not even a space. Any thoughts?

                      "mailto:"& "Campaigns::email"

                      &

                      "?Subject = " & Campaigns_SelectedTemplates::Subject

                      &

                      "&Bcc=" & Campaigns::g_Contact List_Temp

                      &

                      "&Body=" & Campaigns_SelectedTemplates::Body

                      & ¶ &¶ & "¶"  &

                       

                      "Your Password:"   &  Campaigns::password

                       

                      Hi,

                       

                      Two things to try. Both are untested, but I am leaning towards option B being the one that will likely work.

                       

                      a) Enclose your 3 carriage returns within double-quotes.

                      Body=" & Campaigns_SelectedTemplates::Body & "¶¶¶" & "Your Password:" & Campaigns::password

                       

                      b) Use HTML line break coding instead.

                      Body=" & Campaigns_SelectedTemplates::Body & "<br/><br/><br/>" & "Your Password:" & Campaigns::password

                       

                      Regards,

                      Doug

                      • 8. Re: Send email via IWP
                        AlanStirling

                        Hi

                         

                        I see that you are using FileMaker Pro 7.

                         

                        In that case, all pilcrow (¶) characters used in a calculation will need to be enclosed in quotes.

                         

                        Best wishes - Alan Stirling, London UK