Forum Discussion

BethanyHudson's avatar
BethanyHudson
Qrew Trainee
3 years ago

URL Mail To help

I've got a URL formula field that needs to open a draft email with the names [Combined Text Email] and subject
    [Meeting Date] filled in. So far I've gotten the open email part but can't seem to get the rest right. Here is my formula:

    var text Email = "MailTo:" &([Combined Text Email]);
    
    var text Subject = 
      &(ToText([Meeting Date])) &"?Subject=" & "($Subject)"; var text URL = "<a href='https://mail.google.com/mail/u/0/#inbox?compose=DfGhPkmsgkdqdlggxFvglVRkZfcTHWhDXKQCcvMpFWgcvJwfvqpmJnlSrZSPjWFGxGpXhLsdMmJvpJzlxmXGPBWlJlWPCkgbXhKxmtsCqdDmhmTpzpjtsxxB'>Email Contacts</a>"; $URL & "&rdr=" & URLEncode($Subject) & URLEncode($Email)​

      ------------------------------
      Bethany Hudson
      ------------------------------
  • This is my cheat sheet for the MailTo command. It's for a rich text button. It will open an email in whatever the default email client is. I do not know the proper code to specify which email client.

    var text Subject = 
        "Enter Subject Line Text here " & [Add Fields If Desired] ;
     
    var text File = URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e57/v0"; //use this if you want to include a file link

    var text Body = 
         URLEncode("Enter text for body here")
        & "%0A%0A"                                                               //THIS IS A LINE BREAK PLUS SKIPS A LINE
        & URLEncode("Company Name: " & [Company Name]) // EXAMPLE OF HOW TO ENTER TEXT & FIELD
        & "%0D%0A"                                                               //THIS IS A LINE BREAK, DOES NOT SKIP A LINE
        & URLEncode("File Link: " & $File)
        & "%0A%0A"
        & URLEncode("QuickBase Link: " & [Link toSubcontractor Assignment]));

    var text Email = "mailto:ThisName@youremail.com" //WHAT EMAILS ARE IN THE TO LINE
    & "?cc=ThisName@youremail.com"                                 //WHAT EMAILS ARE IN THE CC LINE
    & "&subject=" & URLEncode($Subject)                             //NOTE: If you remove the cc line, then: & "?subject="  (note '?')
    & "&body=" & $Body;                                                                      // The first line after mail to should have a '?' and NO "&". This indicates everything following is being set.

      
    "<a href="
     & $Email
     & ">" & "Create Email" & "</a>"

    ------------------------------
    Mike Tamoush
    ------------------------------