Mailto - more than 1 email address in the CC

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
Here is the top part of the formula I'm using to automate the sending of an email to specific users:

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_662=" & ToText(Today());

var text URLTWO= 

"MailTo:"& URLEncode([Contact Main Email])
&"&cc="& URLEncode([Contact Secondary Email])
&"&bcc=email@email.com"
// the above text invokes the mail client, and creates the TO line
&"?subject=" &  "Store " & [Store No] &  " POS Checkout Site Readiness Survey"

I need to BCC two email addresses. These addresses will always be the same for every email. Is there a way to have two emails in that line? I've tried putting a ; after the first email and then putting the second, but this doesn't seem to work.

While we are at it, is there a way to change the From to a specific email address? I have been having to change that manually to make it come from our project mailbox, rather than my personal email.

Thank you,

Kim
Photo of Kim

Kim

  • 132 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
The ? is the indicator that the rest of the parameters follow, so it needs to be first.


"MailTo:"& URLEncode([Contact Main Email])
& "?subject=" & URLEncode("Store " & [Store No] &  " POS Checkout Site Readiness Survey")

& "&cc="& URLEncode([Contact Secondary Email])
& "&bcc=email@email.com;Fred.flintstone@bedrock.com"
Photo of Kim

Kim

  • 132 Points 100 badge 2x thumb
Thanks Mark. I got the second email to start populating in the BCC field, but the From: still shows as "Outlook". Here is my code:

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_47=" & ToText(Today());

var text URLTWO= 

"MailTo:"& URLEncode([Store No - Contact Main Email])
&"?subject=" &  "Store " & [Store No] &  " POS Checkout Site Readiness Survey and Install Guides / Guides Sondage de préparation du site et installation pour les caisses enregistreuses"

& "&cc="& URLEncode([Store No - Contact Secondary Email])
& "&bcc=checkout@cantire.com;RSSECLEVEL@cantire.com
& "&from:=checkout@cantire.com"
Photo of Kim

Kim

  • 132 Points 100 badge 2x thumb
Also, is there a limit to the number of characters you can have in a formula URL?  I'm creating a bilingual email. It was working fine until I added in some extra text. No errors, and the new tab opens, but it just stays blank. If I take out the extra line of text, the new tab opens to outlook and works correctly.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,884 Points 20k badge 2x thumb
There is no from parameter supported in the mailto protocol. Doing so would be a security issue as you could impersonate any email address.
Photo of Kim

Kim

  • 132 Points 100 badge 2x thumb
That makes perfect sense. Thanks for your reply!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
Special characters will mess up the form so they need to be URL encoded.  Keep in mind that you are building a URL.  It's not the length that is the problem as the URL can be extremely long.  Internet Explorer most restricted in length but its limit is still over 2,000 characters long.

Try this
var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#]) & "&_fid_47=" & ToText(Today());

var text URLTWO= 

"MailTo:"& URLEncode([Store No - Contact Main Email])
&"?subject=" &  URLEncode("Store " & [Store No] &  " POS Checkout Site Readiness Survey and Install Guides / Guides Sondage de préparation du site et installation pour les caisses enregistreuses")

& "&cc="& URLEncode([Store No - Contact Secondary Email])
& "&bcc=checkout@cantire.com;RSSECLEVEL@cantire.com

You will see that I URLEncoded the Subject line.  I removed the from.

I tested it and that worked - almost.  The issue will be the é  in préparation.  Quick Base is not great at handling alternative character sets.  So you may have to drop the é and go with e to get that to work.

Sometimes in French it is easier to get away with dropping the accents if the words are in caps.  ie you may need to ask your French support staff  which is the least worst, just going with e or making that whole subject line in UPPER CASE.

If you need to remind the users to change the "from" manually in Outlook, then you can add some instructions  in the body like

& "&body="& URLEncode("attention: remember to remove this note and change the from to xxxxxx and remember to attach the readiness Survey")
(Edited)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
... I don't know if there is a way to change the from

According to this post here, you cannot change the from as there is no recognized parameter for "from".

https://yoast.com/dev-blog/guide-mailto-links/