If you use CFMAILPARAM, it is nested within a CFMAIL tag. You can use more than one CFMAILPARAM tags within a CFMAIL tag in order to attach one or more files and headers.
FILE
Required if you do not specify the NAME attribute. Attaches the specified file to the message. This attribute is mutually exclusive with the NAME attribute.
NAME
Required if you do not specify the FILE attribute. Specifies the name of the header. Header names are case insensitive. This attribute is mutually exclusive with the FILE attribute.
VALUE
Optional. Indicates the value of the header.
To do what you asked about earlier, I would have your clients set up in a table with a record for each client having their e-mail address and the name of the file to attach.
You can then do a query like this:
<cfquery name="q1" datasource="myDS">
select * from clientTable
</cfquery>
You can then just use the cfmail tag like this to send an e-mail and attach their file.
<cfmail
query="q1"
mimeattach=#q1.clientFile#
to=#q1.clientEmail#
from="billing@ourdomain.com"
subject="Your invoice"
>Here is your invoice......
</cfmail>
If you needed to attach more than one file, I would use the <cfmailparam> tags as Sylvano suggests.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.