filemaker send email with userdata - email

How can I send an email in Filemaker Pro 18 with user data?
I tried something like below but it didn't evaluate and just send the whole thing as a text.

I figured it out, instead of using "+", just use "&" and it'll concatenate the string and variable

Related

Google Apps Script New Line Loss of Formating

I have a google form that gets generic information from the user and saves it all in a sheet. When a new form is submitted, the information is appended together with a new line (\n) command between every new piece of information, and is sent to an email using the Mailapp.sendEmail(email, subject, message) function. This works fine, and is formatted the way I would like it. However, when I use the Mailapp.sendEmail(email, replyEmail, subject, message) function, the \n commands seem to disappear from the code. They do not show up in the email and the information in the email is all grouped together in 1 line. Does anyone know why this might be happening, and how I would be able to get the formatting back? Thanks!
The email is formatted as html. If you change your '\n' to '<br>' it will break the lines.
This was my test:
MailApp.sendEmail("me#myDomain.org","test#example.com" , "Subject", "This<br>Is<br>The<br>Body");

What is the special syntax for a sub email address in local part of address

I have read somewhere, when searching on how to parse email addresses the best way, that it is possible to have a special string in front or after your local-part of the email address, which is ignored for assigning it to a special mailbox. So something like
mysubgroup#myaddress#example.com would match to the mailbox myaddress#example.com
Does anyone know the correct syntax i've tried #$%&?+^~ as deviding charackter all of them didn't work

How to correctly encode commas in email display name?

I have a similar problem to this question, but could not find any useful information in the answers.
I'm trying to send an email to a recipient with a display name Lastname, firstname using the Quoted-Printable encoding. The exact header, as seen in the source of the received email, is:
To: =?UTF-8?Q?"Lastname,=20firstname"?= <email#example.com>
However, Outlook displays it like this:
Effectively interpreting the comma as a separator between recipients, even though it's enclosed in a Quoted-Printable encoding.
When there is no comma, the header is properly interpreted.
Am I doing something wrong, or is it impossible to use commas in a display-name?
Note: I'm currently using Amazon SES and the ZF2 Zend\Mail component, but the tools should not matter, I'm only interested in the correct header format and will adjust my tools or code accordingly.
What you are seeing is not correct behavior as far as I can tell, but the workaround should be obvious: QP-encode the comma. The double quotes are redundant and should be omitted:
From: =?UTF-8?q?Lastname=2C_Firstname?= <email#example.com>
(As such, it is obviously insane to put the last name first; but e.g. Outlook connected to Active Directory seems to insist on this silly anti-convention.)

How do I separate multiple email addresses in cfmail

Do I use a comma or semicolon? I can't seem to find it in the live docs. I also can't seem to find any consistency looking online as some examples use a comma while others use a semicolon. Are both acceptable?
Per https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-m-o/cfmail.html
Message recipient e-mail addresses:
Static address, for example, "support#.com".
Variable that contains an address, for example, "#Form.Email#".
Name of a query column that contains an address, for example,
"#EMail#". An e-mail message is sent
for each returned row.
To specify multiple addresses,
separate the addresses with commas.
(emphasis mine)
I do believe semicolons will work as well.
You can use either of them, and it should be fine. Although for consistency with existing email clients, I'd use a semicolon.
I'm not sure how commas would behave in other CF engines, such as Railo or OpenBD, whereas ; would work on all of them.
Comma separate the email addresses is the answer i found in o'reilly's coldfusion book. its possible semi-colons will work, but commas for sure.
-Don
I think it depends on your mail server. If you're using Exchange, it expects semicolons. Most smtp servers prefer commas. Experiment and see what works for you.

What escaping or purification is needed for an email subject?

Sites like Facebook have the user's name in the subject line that sent you a message.
Because of this, what escaping would you do on user entered values in a message subject? Or would you just not allow anything other than a-z, 0-9, period, comma and single quotes?
You need to be careful with email headers, 8 bit chars are a bit of a no-no. (mail servers will reject them).
The proper way to do it is to MIME encode your subject lines and make sure the ASCII char \n is not in the subject line (technically multi-line subjects are possible, but I'd imagine plenty of mail clients would have problems)
See http://en.wikipedia.org/wiki/MIME#Encoded-Word for more info.
Escaping is needed if there are forbidden characters. The subject is terminated by a NL so this is the only (ASCII) character that shouldn't be put in the header.
See also rfc821
It’s the same problem with contact forms.
If you look at an email header you get e.g. this:
Subject: user123 has sent you an invite
From: "User123" <user123#example.org>
You have to make sure that user names do not resemble values of an email header. If it’s possible for a user to name himself “To: spamreceiver1#example.org, spamreceiver2#example.org, spamreceiver3#example.org, spamreceiver4#example.org” you have to clean the input.
A search for “contact form spam” should show you what to do. You should at least remove all occurrences of "To:", "Subject:", "From:" etc.