Setting mail subject encoding

Dear All,
I'm now developing a web client to send email, all things was fine except when I want to set the subject encoding, I really can't get arround it, coz the javamail api I'm currently using is 1.3, and requirement won't let me change it to 1.4.1 to use the message.setSubject(subject, encoding) method. Any ideas?
ar_fee

What you want is the method
setSubject(String subject, String charset)
That method exists in JavaMail 1.3 as well.

Similar Messages

  • Setting Mail Subject and Body

    Hi,
    I have configured sending a mail with PDF attachment for Invoices in NACE. the program is RLB_INVOICE The mail goes fine with the PDF attachment to external mail address.
    Now I need put subject and Body for the email.
    There are 2 issues now.
    1. In transaction NACE i am using "Mail title and texts" node when i fill the Document title, the same document title appears for the e-mail subject as well as the name of the attachment. But i need different names for the subject and attachment and the invoice number must be present in the subject.
    2. Under the "Text" tab when i maintain some texts, this doesn't appear anywhere in the mail.
    How do i maintain Subject and Body for the e-mail.
    Regards
    Rajvansh

    Hi
    Keep break point at SO_OBJECT_SEND.
    In the first screen
    VF01 / VF02  ->
    Set the Output type not to process immediately, use custom own transaction.
    Save and come out of transaction.
    And again
    VF01/ VF02 ->
    Issue Output type select the Output with medium 5.
    and click on the OK button.
    It should stop.
    To pass value from driver program to Enhancement point.
    I used FIELD SYMBOLS.
    Since i am offline, i do not have exact syntax.
    It will be something like this
    FIELD SYMBOLS : <OUTPUTTYPE> type any.
    ASSIGN '( PROGRAMNAME(FIELD NAME)) TO <OUTPUTTYPE>
    IF <OUTPUTTYPE> IS ASSIGNED.
    ENDIF.
    Or
    If it is custom driver program, you can use memory ID's also
    Regards
    MD

  • Setting Mail Default Encoding

    Is it possible to set outgoing messages encoding to for example UTF-8 and how?

    Amazing! The dingbat-in-my-sig solved a long standing problem for me.
    I write in croatian, using characters as š, ž, č, ć, đ.
    Every time an email went out and it was plain text, the characters displayed properly.
    Any time the mail would be "rich text", the recipients (especially using Outlook on Windows) would get to see chinese characters instead of these ones.
    I really grew tired of forcing every email to plain text mode.
    Putting a dingbat (i used the Daring Fireball one ✪) at the end of my sig now lets me send rich text emails with croatian characters displaying properly!
    Thanks Tom!
    Message was edited by: Daniel Kasaj

  • Cyrillic Subject Encoding in Mail.app

    I have a problem with wrong cyrillic subject font on the message list pane in Mail.app
    Though on the message preview pane everything looks well.
    It has been happening with with only some emails, but it's quite disappointing...
    Can you please advise any workaround for this issue?

    etresoft wrote:
    That is just incorrectly encoded on the sender's side. From the other headers, it looks like a Microsoft bug. Apple Mail is displaying what it receives. The subject line is a plain text header. To include any non-ASCII on the subject line it must be encoded as I have shown above. Otherwise, there is no way to tell that the characters should be something else in Cyrillic.
    That's correct.  On the other hand,  a more robust Mail could guess the subject encoding from the body charset, which it apparently does when displaying the full message, but not in the message list.

  • Encoding non-ASCII in mail subject

    I'm getting =?ANSI_X3.4-1968?Q? in the subject line of my email with non-ASCII character.
    I tried using encodeText from the MimeUtiliy like this but it won't work:
       Message msg = new MimeMessage(session);
                // -- Set the subject and body text --
                msg.setSubject(MimeUtility.encodeText(subject) );How should I go about?
    Thank you
    Niklas

    Thank you very much. I'll make the suggested changes and report back. It's the deafult locale of a virtual dedicated server at secureserver.net which shouldn't be strange. Meanwhile here is the entire method:
      public static void send(String smtpServer, String to, String from
                , String subject, String body, String personal) {
            try {
                log.info("using smtp server:"+smtpServer);
                Properties props = System.getProperties();
                props.put("mail.smtp.host", smtpServer);
                Session session = Session.getDefaultInstance(props, null);
                // -- Create a new message --
                Message msg = new MimeMessage(session);
                // -- Set the FROM and TO fields --
                msg.setFrom(new InternetAddress(from, personal));
                msg.setRecipients(Message.RecipientType.TO,
                        InternetAddress.parse(to, false));      
                // -- Set the subject and body text --
                msg.setSubject(MimeUtility.encodeText(subject) );
                //msg.setSubject(subject, �UTF-8&#8243;);
                //msg.setText(body);
                msg.setContent(body, "text/html");
                // -- Set some other header information --
                msg.setHeader("X-Mailer", "MarketMail");
                msg.setSentDate(new Date());
                // -- Send the message --
                Transport.send(msg);
                //log.info("Message sent OK.");
            } catch (Exception ex) {
                ex.printStackTrace();
       

  • Apple Mail cannot encoding issues (Chinese Asian Language)

    I've abandon Mail for almost 2 years, 2 issues I had before is the 'disappearing mail' and the encoding problem.
    Now with my new MBP 17" I decided to use Mail again. I am getting the encoding problem again.
    Things I tried already:
    1. set the default encoding using Terminal to "BIG5"
    2. check under 'Composing' preference for 'Plain Text', uncheck 'use the same message format as the original message'
    3. Tried manually setting the encoding before sending. But in few instance Apple Mail tells me that there is an Error and cannot change the encoding. Even I succeeded in changing the encoding, there is no guarantee that the other side can read it properly.
    This usually happens when I 'reply' or 'forward' a Chinese email to someone. So far it happens to the HTML type email.
    Still I am getting problem sending mail that Outlook can properly decode by itself. To fix this from the Oulook side, they need to open the message by double click, select encoding for the message, and pick either UTF-8 or BIG5 (if the message is BIG5, select UTF-8 and vise versa) then the message will display properly.
    I know this could be an Outlook problem (probably is) but I cannot tell my customer to change encoding each time. I really need a way to do this from the Apple Mail side.
    The following is just one example of HTML email I replied and turns out to be BIG-5 under Outlook, but user need to select UTF-8 to view it.
    In-Reply-To: <050201c7154d$3fa791c0$bcdd123d@SN012345678912>
    References: <[email protected]> <050201c7154d$3fa791c0$bcdd123d@SN012345678912>
    Mime-Version: 1.0 (Apple Message framework v752.3)
    X-Priority: 3
    Content-Type: multipart/alternative;
    boundary=Apple-Mail-1--121729776
    Message-Id: <[email protected]>
    Cc: =?BIG5?B?RXZhSG/EX7XY?= <[email protected]>,
    =?BIG5?B?SG9sbHlfUG9sYXLEX7XYs6Ks9cRS?= <[email protected]>,
    =?BIG5?B?U3VzYW5hU29vxF+12A==?= <[email protected]>,
    =?BIG5?B?UGh5bGxpc8Rftdg=?= <[email protected]>,
    =?BIG5?B?S0VOLkpJQbjrvuWoyA==?= <[email protected]>,
    "Viv Lee" <[email protected]>,
    =?BIG5?B?SmFuZUNoZW6zr6Tlr3U=?= <[email protected]>,
    =?BIG5?B?RWR3aW5ZYW+rwKWuxe8=?= <[email protected]>,
    =?BIG5?B?MDA3NDalVMBzrvw=?= <[email protected]>
    From: James Yao <[email protected]>
    Subject: =?BIG5?B?UmU6IMRftdizbqT7pdarfr3osN3DRA==?=
    Date: Sat, 2 Dec 2006 07:42:27 +0800
    To: =?BIG5?B?vki0ZqzCIEpvYW4gVGFuZw==?= <[email protected]>
    --Apple-Mail-1--121729776
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=BIG5;
    delsp=yes;
    format=flowed
    Hi xxxx...... (body of the message)
    I need help here, I still like the operation in Apple Mail but this is killing me. Please help.

    Thanks but I tried these already. Didn't seem to work.
    I switched to Thunderbird. Took a while to convert my mailboxes (30+ of them) from emlx to mbox and loaded into Thunderbird.
    Thunderbird is ok, address book really ***** since it doesn't work with the OSX Address book at all. I had to use vcf2ldif to convert address book but the Chinese character in the Address Book all became ??? in Thunderbird. And the time it takes to convert 400+ address is long (I already filtered the address book from my 1000+ contact)
    Font setting in Thunderbird is not good as well. Emails in my folders are in different fonts all the time due to the difference in encoding. I just need to get used to it.
    If Apple Mail can just handle encoding better, I will never switch. Both my customer and my family are having same problem, (because we all read/send Chinese Traditional email) Apple should do something. Already send email regarding this to Apple, and if there are other people with the same problem as me, pleas let Apple know about this.

  • Alert management with custom mail subject

    Hello,
    I defined a business process, with a control step that throws an alert with a specific message "Error in &MessageTypeFound& " ( &MessageTypeFound& being a container element filled in in a previous step ).
    When I look at the e-mail that the alert manager sent, I can see the alert, with the variable properly filled in, so the result in the mail-body is: "Error in WMMBXY".
    Now, as a mail subject, I want the same message. In the Alert Category Definitions, I need to fill in the title and this will be used as mail subject.
    To be able to use variables in this title, I need to define container elements in the alert category definition. How can I pass the Business Process variable ( &MessageTypeFound& ) to this container for the alert definition ? (So I can use this container element for my dynamic variable in the subject of the alert mail)
    Any ideas are welcome !
    Thanks

    Hi Frederik,
    Unfortunately the functionality you want is simply not available ... or well it is but its not implemented very good by SAP.
    The workflow step that generates an alert does has a container element 'SHORTTEXT' which can hold placeholders and which is translated into the title of the alert message/mail.
    However, the field is defaulted with the text 'Process &_WORKITEM.WORKITEMID&' when being executed via BPM ...
    I tried to overwrite it by setting my own 'SHORTTEXT'container element within the BPM but that does not work ...
    Regards,
    Steven
    ( Tried everything on SP14 ... maybe something changed in SP15 ... )

  • Dynamic mail subject in File2Mail Scenario

    We are doing File2Mail scenario. We r sending 5 files in 5 mails with 5 diff subjects by MAIL adapter.
    Can anyone guide me how to send 5 files as attachment in one single mail with different mail subjects :
    File names are - Employee_Leave,Base,Super,Loss,Profit.

    Hey,
         you can use dynamic addressing wherein you can provide the mail related information in your mapping.
    for example the to, from, subject and content.
    so you can map these fields form the input structure or you can have a constant to map it.
    refer to this blog it will really help.
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    the only differerence in your case is that you need file as attachment so mark the keep attachment field.
    it will ask you for a mail structure.
    use this structure as your target structure.
    <?xml version="1.0" encoding="utf-8" ?>
    - <!--
    SAP takes no position regarding the validity or scope of any intellectual property or
    other rights that might be claimed to pertain to the implementation or use of the
    technology described in this document or the extent to which any license under such
    rights might or might not be available; neither does it represent that it has made any
    effort to identify any such rights.
    Copyright © SAP 2003-2004. All Rights Reserved.
    This document and translations of it may be copied and furnished to others, and derivative
    works that comment on or otherwise explain it or assist in its implementation may be
    prepared, copied, published and distributed, in whole or in part, without restriction of
    any kind, provided that the above copyright notice and this paragraph are included on all
    such copies and derivative works. However, this document itself does not be modified in
    any way, such as by removing the copyright notice or references to SAP.
    This document and the information contained herein is provided on an u201CAS ISu201D
    basis and SAP DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
    ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY
    IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
      -->
    - <xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30" xmlns:xi="http://sap.com/xi/XI/Mail/30" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <!--
    Mail
      -->
    - <xs:element name="Mail">
    - <xs:annotation>
      <xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>
      </xs:annotation>
    - <xs:complexType>
    - <xs:sequence>
      <xs:element name="Subject" type="xs:string" minOccurs="0" />
      <xs:element name="From" type="xs:string" minOccurs="0" />
      <xs:element name="To" type="xs:string" minOccurs="0" />
      <xs:element name="Reply_To" type="xs:string" minOccurs="0" />
      <xs:element name="Content_Type" type="xs:string" minOccurs="0" />
      <xs:element name="Date" type="xs:dateTime" minOccurs="0" />
      <xs:element name="Message_ID" type="xs:string" minOccurs="0" />
      <xs:element name="X_Mailer" type="xs:string" minOccurs="0" />
    - <xs:element name="Content" minOccurs="0">
    - <xs:annotation>
      <xs:documentation>any type</xs:documentation>
      </xs:annotation>
      </xs:element>
      </xs:sequence>
      <xs:attribute name="encoding" type="xs:string" />
      </xs:complexType>
      </xs:element>
    - <xs:element name="MailReceipt">
    - <xs:annotation>
      <xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>
      </xs:annotation>
    - <xs:complexType>
    - <xs:sequence>
      <xs:element name="Server" type="xs:string" />
      <xs:element name="Format" type="xs:string" />
      <xs:element name="UseMailPackage" type="xs:boolean" />
      <xs:element name="Encoding" type="xs:string" />
      <xs:element name="Subject" type="xs:string" minOccurs="0" />
      <xs:element name="From" type="xs:dateTime" minOccurs="0" />
      <xs:element name="To" type="xs:string" minOccurs="0" />
      <xs:element name="Date" type="xs:dateTime" minOccurs="0" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      </xs:schema>
    reward points if useful.
    regards,
            Milan.

  • Why did TB set the char encoding for a reply to charset=UTF-16LE ?

    I got a message from Google AdWords in HTML format and wrote a reply. When I sent it I got a timeout trying to send it. I use AVG antivirus to scan outgoing messages using a "local server" at address 127.0.0.1.
    Note that this was my second reply to such a message from AdWords. The only thing I could see that was different was a longer subject line (ending with three periods or dots) and a longer HTML message to which I was replying.
    I tried many things to fix the problem and I cannot remember them, sorry.
    Finally, I got success after truncating the message and the long subject line. The reply was sent instantly, as usual, instead of timing out.
    But it wasn't really success. When I looked at the sent message, the characters in my reply (only) were in Chinese. Looking at the raw (source) message, I see that the charset was set as follows: Content-Type: text/plain; charset=UTF-16LE; format=flowed .
    This seems like a strange charset; nowhere in my settings do I specify anything other than Western (ISO-8859-1).
    I finally was able to send the message successfully (I think) by using Options > Character Encoding > Western (ISO-8859-1), which seems to force the message to be sent using this standard encoding instead of Little Endian.
    What caused this problem to happen? Is there a TB overflow bug for long subject lines?
    I realize that TB is an old and unsupported product, but it seems to be the only good email client to use with Windows 8, so I'm just hoping someone knows something about this.

    Originally posted by: warren.tang.nospam.com
    Warren Tang wrote:
    > Warren Tang wrote:
    >> Warren Tang wrote:
    >>> Hi everybody,
    >>>
    >>> I've been trying to set the default encoding of new files as UTF-8.
    >>> Here are the two settings I've set:
    >>>
    >>> 1. Windows > Preferences > General > Content Types, set UTF-8 as the
    >>> default encoding for all content types.
    >>> 2. Windows > Preferences > General > Workspaces, set "Text file
    >>> encoding" to "Other : UTF-8".
    >>>
    >>> However when I create a new text file, the encoding is always
    >>> ANSI/ISO-8859-1. What did I missed? Thanks.
    >>>
    >>> Regards,
    >>> Warren
    >>
    >> I've also tried
    >> Project Properties > Resource > Text file encoding = UTF-8
    >> However it doesn't work either.
    >>
    >> The only thing that works is changing the file's encoding property,
    >> but I don't want to change it every time I create a new file.
    >>
    >> Is it a bug?
    >
    > It turns out that there are other places I need to set up for HTML and
    > CSS files:
    >
    > Windows > Preferences > Web > CSS Files > Encoding = UTF-8
    > Windows > Preferences > Web > HTML Files > Encoding = UTF-8
    I'm getting mad... The file (on the disk) is still not encoded in UTF-8
    but ANSI.

  • Is it possible to set a subject in a mailto link?

    It would be nice to set a subject in a mailto link when you create it in Muse. The subject of the mail that is already there for the user, also very handy for the person who receives the mails, to organize and see quickly on which subject the mail was send. This was possible in ancient iWeb….
    Thank you

    Yes, it is possible. Here is the syntax:
    mailto:[email protected]?subject=Hello again&body=Predefined body text
    • ?subject=xxx sets the subject
    • &body=xxx predefines an e-mail text

  • Outlook mail app display arabic mail subjects and folders names as "??????"

    outlook mail app display arabic mail subjects and folders names as "??????" , any way to solve this problem ? thanks

    Skydiver119 wrote:
    the ipad likely doesn't have a font to display the mails
    That's nonsense, if you look at the settings you will see you can put the entire device into Arabic if you want, as well as type and read Arabic emails and other docs.  The font is there, but for some reason the encoding is botched, either by the app or the place sending the email to the iPad.

  • Mail subject warning

    I really find it annoying that I can not turn off the 'no subject' warning. To suggest I should is none of anyone's business. The subject line is purely personal preference - especially since I am sending email to family. When I send email for work I use the subject line.
    There should be a way of turning off the subject warning. And for work it would be convenient if there was a way of using 'RULES' under mail preferences to set up the warning for work related emails.

    Ernie,
    I don't think your personal preference on mail Subject lines is really the point of this thread. I, too, like the fella who started this thread, am constantly annoyed by the unnecessary prompt. Smacks smartly of Microsoft-ian programming: helpful to the point of being intrusive.
    Further, I believe there is a way to do it. Unfortunately, I am not a Unix guy who knows how to implement this, but I found this link to the man pages for mail. Find the "ask, asksub" entry under Mail Options in the manual. Seems to say there is a built-in feature of Mail that can be turned on and off at will.
    http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/mail.1.h tml
    Eric
    Message was edited by: xhat

  • My e-mail subject line is repeated when I try to open an e-mail

    My e-mail subject line is repeated when I try to open an e-mail, so I have to open this line too, before I can read my e-mail. It takes up alot of space & means I have to do another unnecessary thing for EVERY e -mail ! Then I have to CLOSE it twice to get out! What is happening?

    I am having the exact same problem with my Macbook Pro, all of a sudden the password started rejecting and I cannot use that gmail account.  This appears to be a bug.  The quick fix was to set up another gmail account and forward the mail from the old gmail account to the new gmail account that works with the IMAP service.  This way the mail from the gmail account with the rejected password will still come through and appear in MAIL.

  • Mail Attachment with attachment name = mail subject name

    Hi,
    I am using the mail adapter and today I am using hard codes attachment names using the MessageTransformBean. I have read the blog /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution about dynamic filenames but how do I get the eMail subject as a viriable to create the attachment?
    Thanks
    Juergen

    Juergen my weblog was the simplest suggestion to your issue - you can put the mail subject anywhere in
    message get it (and remove) in the adapter module
    you can also try to get the
    Adapter-Specific Message Attributes from the adapter module 
    http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/content.htm
    but I'm not sure it the second solution works with adapter modules - but you can do an easy check
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Purchase order by e-mail: changing the e-mail subject

    Hello all,
    We are sending are purchase orders to the vendors by e-mail.
    I would like to know how can I change the e-mail subject to a subject of my choice (for instance the PO number, etc.).
    Thanks for your help,
    Sivan

    Hi,
    You can  change the e-mail subject to a subject of your choice by following way.
    If you want to send a purchase order as (external) mail, for example, to a
    vendor, you have to maintain the mail title in the condition record for the
    output type (for example in Transaction MN05) on the 'Communication method' tab
    page. Enter the mail title in the 'Text for cover page' field. You cannot
    maintain an additional mail text.
    Hope this will help u,
    Deepak

Maybe you are looking for