Sending E-mail
To send email, use cfmail tag making sure you set asyc=false (see below). Not setting this flag to false may result in undelivered email because mail may still exist in Lucee spooler (Lucee tasks) when your task runner exits.
1
mail
2
subject=subject
3
from=from
4
to=to
5
cc=cc
6
bcc=bcc
7
replyTo=replyTo
8
type=type
9
server=server
10
port=port
11
username=username
12
password=password
13
useTls=tls
14
usessl=ssl
15
async=false {
16
writeOutput(emailBody);
17
};
Copied!

Connecting to SMTP Services Using SSL or TLS

If you cannot connect to a SMTP server that requires SSL or TLS, like Amazon SES, one workaround is to install a local SMTP server and configure it as a relay to your SMTP server. This has been done successfully on Windows servers using hMailServer (free, opensource), which is fairly easy to install and configure as an SMTP relay.
Last modified 5mo ago