<cfmailparam>
Can either attach a file or add a header to a message.
It is nested within a [tag-mail] tag.
You can use more than one cfmailparam tag within a cfmail tag.
This tag cannot have a body.
This tag is also supported within <cfscript>
<cfmailparam
file=string
filename=string
name=string
value=string
type=string
disposition=string
contentId=string
remove=boolean
content=any
>
| Attribute | Description |
|---|---|
file
string, optional
|
edit
Attaches the specified file to the message. This attribute is mutually exclusive with the name attribute. |
filename
string, optional
|
edit
file name used for the file attached with the attribute "file", if not set the name of the file itself is used. |
name
string, optional
|
edit
Specifies the name of the header. Header names are case insensitive. This attribute is mutually exclusive with the file attribute. |
value
string, optional
|
edit
Indicates the value of the header. |
type
string, optional
|
edit
The MIME media type of the part. |
disposition
string, optional
|
edit
How the attached file is to be handled. Can be one of the following:
|
contentId
string, optional
|
edit
The Identifier for the attached file. This ID should be globally unique and is used to identify the file in an IMG or other tag in the mail body that references the file content. |
remove
boolean, optional
|
edit
remove attachment from filesystem after the mail is successfully sent |
content
any, optional
|
edit
send given value as attachment |
Examples
editSimple example for cfmailparam
<cftry>
<cfmail from="sender@example.com" to="receiver@example.com" subject="mailparam example" server="smtp.gmail.com">
<cfmailparam name="header" value="Mail header">
Mailparam header example
</cfmail>
<cfcatch>
<cfdump var="#cfcatch.message#" />
</cfcatch>
</cftry>
See also
- Sending Emails
- <cfmail>
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)