LelloLello
asked on
my CFMAIL doesn't work properly.
Hello,
I have a coldfusion which display information from a SQL database. I've add a function of CFMAIL that everytime the use click the button 'update' the new record will update the database and send an email.
But i have a problem everytime i refresh that page an email will be sent... What I want that everytime the user CLICK the 'update' button an email should be generated.
thank you
HEre is m code:
I know i should put an if but i'm using form post please see my code.
<form action="update_account_inf o_e.cfm?Ta sk=UpdateI nfo" method="post">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="qtable">
<tr>
<td align="right" bgcolor="78A8D2" width="50%"><font color="white" size="2"><font face="arial" size="2"><b>First Name: </b></font></td>
<CFOUTPUT>
<td ALIGN="LEFT" width="50%"><font size="3"><input type="text" name="firstname" value="#DisplayUser.firstn ame#"> </font></td>
</CFOUTPUT>
</form>
<CFMAIL FROM="abc@datanet.ca"
SERVER="mail.abc.ca"
SUBJECT="Test Update"
TO="status@datanet.ca">
The following information is sent by this client, please
respond accordingly
At #DateFormat(now(),
'mmm dd, yyyy')# #TimeFormat(now(),
'hh:mm tt')#,
Name: #DisplayUser.lastname#
</CFMAIL>
I have a coldfusion which display information from a SQL database. I've add a function of CFMAIL that everytime the use click the button 'update' the new record will update the database and send an email.
But i have a problem everytime i refresh that page an email will be sent... What I want that everytime the user CLICK the 'update' button an email should be generated.
thank you
HEre is m code:
I know i should put an if but i'm using form post please see my code.
<form action="update_account_inf
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="qtable">
<tr>
<td align="right" bgcolor="78A8D2" width="50%"><font color="white" size="2"><font face="arial" size="2"><b>First Name: </b></font></td>
<CFOUTPUT>
<td ALIGN="LEFT" width="50%"><font size="3"><input type="text" name="firstname" value="#DisplayUser.firstn
</CFOUTPUT>
</form>
<CFMAIL FROM="abc@datanet.ca"
SERVER="mail.abc.ca"
SUBJECT="Test Update"
TO="status@datanet.ca">
The following information is sent by this client, please
respond accordingly
At #DateFormat(now(),
'mmm dd, yyyy')# #TimeFormat(now(),
'hh:mm tt')#,
Name: #DisplayUser.lastname#
</CFMAIL>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you.
ASKER
<cfif Task eq "email">
Where in my code, please open my code. and how i should call the email.
So only the if they update the info an email should go. currenlty everytime i load that page an email is send :(.
update.txt