Skip to main content
Question

Help with creating email syntax

  • Sep 29, 2021 7:28 PM UTC
  • 0 replies
  • 47 views

Forum|alt.badge.img+14
I have the following code and it works fine, but if I remove the cc: line, it does not work.

Working Code:

var text Subject =
"Subject Text" ;

var text Body =
URLEncode("Body Text");

var text Email = "mailto:Email@email.com" &
& "?cc=Email@email.com"
& "&subject=" & URLEncode($Subject)
& "&body=" & $Body;

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

However, if I comment out the cc line, it doesn't know the next line is the subject, and then the body. It will just string together the subject and body and treat it like another 'To' email address.

What syntax am I supposed to add or change when removing the cc? I am using a formula rich text field.

------------------------------
Michael Tamoush
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
The ? indicates the start of the rest of the parameters after this "mailto:Email@email.com" 

so, if you remove that cc line then you need to retain the "?"
For example 

var text Email = "mailto:Email@email.com" &
//& "?cc=Email@email.com"
& "?subject=" & URLEncode($Subject) // include the ? delimiter here
& "&body=" & $Body;

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


------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------