Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default CFMAIL question

    anyone in this forum ever use CFIF inside a CFMAIL statement? Reason being, I
    want to cc to a different group of people base on certain condition, the idea
    is , if possible eg: <cfmail type='HTML' query='Contract'
    from='system@webserver' to='#alertmail#' <CFIF #org_id# EQ '200'>
    cc='SuYin.Lim@cfl.com' <CFELSE> cc=' [email]SharifulAzam.Ismail@abc.com[/email]'
    </CFIF> group='alertmail' subject='Notification'> Hi , <br>
    &amp;nbsp;&amp;nbsp;&amp;nbsp;Your action is required below :<br> </CFMAIL>
    is this statement valid, anyone tried it b4? thanks for listening...

    FL_Chong Guest

  2. Similar Questions and Discussions

    1. CFMAIL admin question
      When CFADMIN mailserver setting is set to the IP of my mailserver, everything works fine. When settings is set to mail.url.com I get a connection...
    2. Basic CFMail and onSubmit question
      Try changing <form name= "validation" onSubmit action="thanks.cfm" method="post"> to <form name= "validation" action="thanks.cfm" method="post">
    3. question about cfdocument,cfmail and forms
      What would be the best way to send a form through cfmail, that would let the user fill in form fields and store those fields when replying back....
    4. Sending files with CFMAIL and CFMAILPARAM question
      I am generating a PDF filename based on the URL, and I can verify that the file does get created correctly, but my problem is that once the...
    5. CFMAIL and formatting question
      I am using CFMX 7 and CFMAIL to send a 'newsletter' to a bunch of customers. I have all my CSS in the CFML code itself instead of attaching the...
  3. #2

    Default Re: CFMAIL question

    I would just give it a try and see if it works. If it doesn't then why don't
    you just do the test before the cfmail and set a variable to go in the cc field?



    <cfif org_id IS 200>
    <cfset MailCC = "SuYin.Lim@cfl.com">
    <cfelse>
    <cfset MailCC = "SharifulAzam.Ismail@abc.com">
    </cfif>

    <cfmail
    type="HTML"
    query="Contract"
    from="system@webserver"
    to="#alertmail#"
    cc="#MailCC#"
    group="alertmail"
    subject="Notification">

    Stressed_Simon Guest

  4. #3

    Default Re: CFMAIL question

    it doesn't work. You cannot do it this way. But, why don't you do it like this?

    <CFIF org_id EQ '200'>
    <cfset variables.ccAddress = "SuYin.Lim@cfl.com">
    <CFELSE>
    <cfset variables.ccAddress = "SharifulAzam.Ismail@abc.com">
    </CFIF>

    and then

    <cfmail
    type="HTML"
    query="Contract"
    from="system@webserver"
    to="#alertmail#"
    cc="#variables.ccAddress#"
    group="alertmail"
    subject="Notification">

    pukkel Guest

  5. #4

    Default cfmail Question

    Why is it that when I'm using cfmail, I can't include two separate email
    address in the 'To' field? I've tried commas, semicolons, etc, and Coldfusion
    is reading it as one long email address. What am I doing wrong? Thanks, Ryan

    rascalhudy Guest

  6. #5

    Default Re: cfmail Question

    Please post your CFMAIL tag.
    jdeline Guest

  7. #6

    Default Re: cfmail Question

    You should be able to do that, are you dynamically adding addresses to the To field?

    Can you put your code up so I can check it.

    Thank
    akulla Guest

  8. #7

    Default Re: cfmail Question

    I got it, no idea why it wasn't working because I knew I had the right syntax. No, I'm dynamically generating the CC field, not the To field

    Thanks for the help!
    rascalhudy Guest

  9. #8

    Default Re: cfmail Question

    I have a question in this area, I am rebuilding all my forms using flash forms
    with mx7 but it seems the cfmail wont work with these forms. I have tried it
    in the cfc, on the same pages, on the action page. Funny thing is this cfmail
    worked fine in the html forms, but since the transition to flash forms, its a
    no go.

    Any suggestions or examples?

    Ezdno Guest

  10. #9

    Default CFMAIL Question

    Hi,
    This may be more of an admin question but when I use the CFMAIL tag eg:

    <CFMAIL to="aninvalidaddress@invalid.com" from="valid@valid.com"
    failto="failtoaddress@failto.com" subject="test message" type="html">
    Test
    </CFMAIL>

    In my "to" field, I specified an invalid address and ofcourse coldfusion will
    not send the message, but its also not sending notification to my failto
    address that the delivery failed. Im using CFMX 6.1, does anyone know why this
    isnt working?

    Thanks

    coldskool Guest

  11. #10

    Default Re: CFMAIL question

    Thank You so much,
    I was looking in the direction of having a different subject based upon a condition. I followed the help provided and the reduced my code by 15 lines of extra code. Thanks. I really appreciate it.

    Veeru.
    Cold Fusion Rookie.
    Veeru Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139