CFMAIL - Unicode filename for attachments

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFMAIL - Unicode filename for attachments

    Hello again PaulH,
    I am hoping you can give me some advice about this.
    I have the charset attribute set to "utf-8". See attached code.
    I've resolved my earlier issue about inserting (or replacing) text in the
    unicode RTF doc, but the file name would be nice to have in Chinese as well.
    Thanks,
    Sierra

    <CFMAIL TO="#FullName# <#Form.email#>"
    FROM="Me <me@me.com>"
    SUBJECT="Results for #Fullname#"
    TYPE="HTML"
    spoolEnable="no"
    charset="#charset#">
    <cfmailparam
    file = "#new_file#"
    type ="text/rtf"/>

    sbufe Guest

  2. Similar Questions and Discussions

    1. Dynamically Including CFMAIL Attachments
      Please help! I am wrting an app that uses CFMAIL, and need to dynamically attach files based on locations and filenames stored in a table. I...
    2. Adding Multiple Attachments to CFMAIL
      Is there a way to add multiple mime files using <CFMAIL>? Here is the code I am using, but it doesn't work. When I comment out the second mime...
    3. 2 attachments in CFMail
      I think the summary says it all. Anyone know the syntax for this? Assuming it is possible of course :-)
    4. Adding attachments to cfmail
      I have a form that allows a user to send an email to a list with the option of adding an attachment. The action page uploads the file, using cffile,...
    5. cfmail - Attribute validation error for tag CFMAIL.
      I'm getting the error ' Attribute validation error for tag CFMAIL.' on the code below. All its doing is outputting a text string to the TO: field. ...
  3. #2

    Default Re: CFMAIL - Unicode filename for attachments

    while i haven't tried that w/RTF docs that technique certainly works w/other kinds of attachments. though it depends on the email client and i guess to some extent on their mail server.

    PaulH Guest

  4. #3

    Default Re: CFMAIL - Unicode filename for attachments

    Hi PaulH,
    Still working on this. Please see attached snippet from the source of the
    email, with attachment.
    This is what happens if I send it out using utf-8 everywhere that I can put
    it, but without doing anything to the chinese file name (like URLEncodedFormat).
    Sierra

    Pertinent CF Source:

    <cfset FullName = udata.NameLast & udata.NameFirst>
    <cfset file_name = "Print_Description_#FullName#.rtf">

    <!--- Where do I temporarily stick the new file? --->
    <cfset new_file = "#docs_path#outfile\#file_name#">

    <CFFILE ACTION="Write" FILE="#new_file#" OUTPUT="#rtf#" charset="utf-8"
    nameconflict="overwrite">

    <!--- Send Email w Attachment --->
    <CFMAIL TO="#emailaddress#"
    FROM="Print Survey Results <surveyresults@printsurvey.com>"
    SUBJECT="Results for #FullName#"
    TYPE="HTML"
    TIMEOUT="30"
    spoolEnable="no"
    charset="utf-8">
    <cfmailparam
    file="#new_file#"
    type="text/rtf; charset=utf-8">

    Email Source:

    Content-Type: text/rtf; charset=utf-8
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment;
    filename*0*=utf-8''Print_Description_PAUL%20732%20;
    filename*1*=%e4%bf%97%e8%af%ad%e8%af%b4;
    filename*2=.rtf

    sbufe Guest

  5. #4

    Default Re: CFMAIL - Unicode filename for attachments

    It arrives in my GMail with this file name:

    utf-8''Print_Description_PAUL%20732%20

    It is not recognized as a RTF doc, because only the first line of the source
    filename is read, and it doesn't have an extension anymore.
    Sierra

    sbufe Guest

  6. #5

    Default Re: CFMAIL - Unicode filename for attachments

    Here is a sample of email source that DOES display Chinese chars in my GMail.
    Sierra

    Content-Type: text/plain;
    name="=?gb2312?B?1tDOxMP7s8YudHh0?="
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="=?gb2312?B?1tDOxMP7s8YudHh0?="

    sbufe Guest

  7. #6

    Default Re: CFMAIL - Unicode filename for attachments

    When I use the name in the "type" attribute, and escape out the quotes to make
    it match the previous email source sample, it comes through as that Chinese
    file name, something-or-other.txt.
    See attached CF code.
    So, I wonder how I can manipulate that attribute to become what I need? I
    don't even see ".txt" legible in it.
    Sierra

    <cfmailparam
    file="#new_file#"
    type="text/rtf; name=""=?gb2312?B?1tDOxMP7s8YudHh0?=""">

    sbufe Guest

  8. #7

    Default Re: CFMAIL - Unicode filename for attachments

    not sure if that's an issue w/rtf files (i just tested again w/.txt, .doc files
    using thai/arabic language names & these worked just fine) or something else
    (that something else being your email client, what you say works is using
    gb2312 not utf-8). if i get a chance i'll look into this some more over the
    weekend.


    PaulH 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