Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing Invoices with CF 5 Question for GJ

Status
Not open for further replies.

scottd431

IS-IT--Management
Apr 18, 2002
46
US
GJ
I am very inexperienced with CF. Should I still use the CFMAIL command with the CFQUERY and the CFMAILPARAM? Thanks for your suggestion
 
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.

Syntax:
<CFMAIL
TO=&quot;recipient&quot;
SUBJECT=&quot;msg_subject&quot;
FROM=&quot;sender&quot;
...more attibutes...>
<CFMAILPARAM
FILE=&quot;file-name&quot;>
or
<CFMAILPARAM
NAME=&quot;header-name&quot;
VALUE=&quot;header-value&quot;>
...
</CFMAIL>

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.


Sylvano
dsylvano@hotmail.com
 
Hey Scott,

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=&quot;q1&quot; datasource=&quot;myDS&quot;>
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=&quot;q1&quot;
mimeattach=#q1.clientFile#
to=#q1.clientEmail#
from=&quot;billing@ourdomain.com&quot;
subject=&quot;Your invoice&quot;
>Here is your invoice......
</cfmail>

If you needed to attach more than one file, I would use the <cfmailparam> tags as Sylvano suggests.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top