Skip to main content
Inspiring
November 21, 2012
Question

Email Notification

  • November 21, 2012
  • 1 reply
  • 4665 views

(I first posted this on the dynamic dreamweaver forum but I think I was supposed to post my question here)

Hi,

I'm trying to figure out a way to notify someone that another person has replied to a post they made in a discussion.  I'm pretty sure I know how to figure out who the email should be sent to, but for now I'm just trying to get it to work by just sending it to my personal email.  This is the code I'm trying to get to work:

Thanks,

Mike

======================================================================

                  <cfif isDefined("FORM.title")>

  <cfprocessingdirective suppresswhitespace="No">

      <span class="blogtitle">Your Email has been sent.<br><br>I'll get back to you as soon as I can.

    </span>

  

  <cfmail

                    TO="mikewycklendt@gmail.com"

        from="""#FORM.username#"" <mikewycklendt@mymindsnotright.com>"

        subject="#FORM.title#"

        server="scriptmail.intermedia.net" 

        >This is a message from #FORM.username#:

Email: #FORM.username#

-------------------------------------------------

#FORM.content#

</cfmail>

  

    </cfprocessingdirective>

  <cfelse>

<form method="post" name="form1" action="<cfoutput>#CurrentPage#</cfoutput>">

                    <table align="center" cellpadding="4">

                      <tr valign="baseline">

                        <td colspan="2" align="left" nowrap bgcolor="#FFFFFF" class="blogtitle"> </td>

                        </tr>

                      <tr valign="baseline">

                        <td align="right" nowrap class="bloguserandwho"> </td>

                        <td><input type="hidden" name="user_id" value="<cfoutput>#rsGetUserID.user_id#</cfoutput>" size="32"></td>

                      </tr>

                      <tr valign="baseline">

                        <td align="right" nowrap class="bloguserandwho">Username:</td>

                        <td><input type="hidden" name="username" id="username" value="<cfoutput>#Session.MM_Username#</cfoutput>" size="32" />                          <cfoutput>#Session.MM_Username#</cfoutput>

                        

                        

                        

                        

                        

                          </td>

                      </tr>

                      <tr valign="baseline">

                        <td align="right" nowrap class="bloguserandwho">Title:</td>

                        <td><input type="text" name="title" id="title" value="" size="32"></td>

                      </tr>

                      <tr valign="baseline">

                        <td align="right" valign="top" nowrap class="bloguserandwho">Content:</td>

                        <td><textarea name="content"  id="content" cols="30" rows="5"></textarea></td>

                      </tr>

                      <tr valign="baseline">

                        <td nowrap align="right"> </td>

                        <td><input type="submit" value="Post Reply"></td>

                      </tr>

                    </table>

    <input type="hidden" name="reply_id" value="<cfoutput>#IncrementValue(rsReplyRecordCount.RecordCount)#</cf output>">

                    <input type="hidden" name="post_id" value="<cfoutput>#URL.post_id#</cfoutput>">

                    <input type="hidden" name="board_id" value="1">

                    <input type="hidden" name="date" value="<cfoutput>#now()#</cfoutput>">

                    <input type="hidden" name="MM_InsertRecord" value="form1">

                  </form>

                           </cfif>

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    November 21, 2012

    Could you tell us what the problem is.

    wycksAuthor
    Inspiring
    November 21, 2012

    Oh yeah, I guess I didn't.  I know that the cfmail won't work on localhost but I uploaded it to my site to test it.  The form itself works (it posts a reply to a topic) but no email is sent.

    BKBK
    Community Expert
    Community Expert
    November 21, 2012

    Comment out the rest of the code and run just this test code:

    Your Email has been sent.<br>

    I'll get back to you as soon as I can.<br>

    <cfmail

    to="mikewycklendt@gmail.com"

    from="mikewycklendt@mymindsnotright.com"

    subject="Test title"

    server="scriptmail.intermedia.net">

    E-mail message sent as test.

    </cfmail>