Text formatting in mail!!!!!!!!! URGENT
hello,
i am using JavaMail API.
i want to format my text which will be in body of mail.
e.g if if enter <b></b> then it should make that text bold.
basicaaly i want support for <b><br><u><i> etc..........
now wht is happening is if i enter <b>Hello </b> inteaf of printing Hello in bold it prints tags as it is.
pls help me.
thanks.
What you need to do is in your MimeBodyPart set the content to text/html:
String bodyText = "What I want <b>bolded</b>.";
MimeBodyPart text = new MimeBodyPart();
text.setDisposition(Part.INLINE);
text.setContent(bodyText, "text/html");
you could also try:
text.setContent(bodyText, "text/richtext");
Al
Similar Messages
-
Hi All
I have a labview application that send mail every hour automatically.
But actually the mail has to be decoded from the web server(by another application).But now when that application decode the data in the mail(that is send by labview application)its getting some funny characters inside that can not be detected by the decoding application
(When open the mail no problem.)But actually our goal is to decode the mail from the web server.
Why the extra characters are appearing when decoding from the server?Is it because of the HTML format?
Is there option to send the mail in plain text format(not like attachment)?
In outlook we can change the setting (tools->options->send->mail sending format->....here we can set as HTML format/Plain Text format)
Like that at the sending time can i chenge the sending option as plain text format in my labview application?
Thanks...smercurio_fc wrote:
Then it sounds to me like this other application is not decoding the attachment correctly, especially if you looked at the attachment yourself after you received it and verified it's correct.
No, no, smercurio. This is charcter encoding here. In older versions of LabVIEW you could specify what character encoding to use when sending an email through the SMTP VIs. But that gave problems since people in certain locales used certain characters that where not transfered right when the wrong encoding was specified, and that encoding stuff is not understood by most people at all, so the wrong selected encoding was rather the rule than the exception. In newer versions of LabVIEW do the SMTP VIs handle the encoding automatically based on the currently used locale on the system.
This change is documented in the Upgrade Notes of LabVIEW and probably happened around LabVIEW 7.1 or 8.0.
A decent mail client will recognize the encoding and convert it back to whatever is necessary before presenting it to the user. The OPs posters server application obviously isn't a smart mail client but probably just some crude text file parser that has no notion of proper mail character encoding and how to deal with it.
I would suppose that there is a chance to dig into the SMTP VIs itself and try to manipulate or disable that encoding altogether in there but that may open a whole can of worms somewhere else. The proper way would be to process the incoming mail by a character encoding aware mail client before passing it to the text parser. On Unix setting up something like this would be fairly trivial.
Rolf Kalbermatter
Message Edited by rolfk on 01-23-2008 10:21 AM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Reading Word attachments (with Rich Text Format) in Mail
I have difficulty opening "Word email attachments" that contain "Rich Text Format" using my ipod touch under the MAIL function. For normal Word documents, I have no issue at all. Can anyone help here? Thank you.
RTF contains alot of extra formatting junk that you need to be aware of, depends what you want to do with the files afte reading them in but JAVA has its own RTF parser standard. Be warned its not full proof.....
import java.io.*;
import java.util.StringTokenizer;
import javax.swing.text.rtf.RTFEditorKit;
import javax.swing.text.Document;
try {
FileInputStream stream = new FileInputStream("C:/Document.rtf");
RTFEditorKit kit = new RTFEditorKit();
Document doc = kit.createDefaultDocument();
kit.read(stream, doc, 0);
String plainText = doc.getText(0, doc.getLength());
BufferedReader br = new BufferedReader(new StringReader(plainText));
String line = br.readLine();
while (line != null) {
StringTokenizer tok = new StringTokenizer(line, " ");
while (tok.hasMoreTokens()) {
System.out.print(tok.nextToken() + " ");
System.out.println();
line = br.readLine();
} catch (Exception ex) {} -
Text format E-Mail to Vendor (PO) using BADI BBP_OUTPUT_CHANGE_SF
Hi all,
I am using BAdI BBP_OUTPUT_CHANGE_SF to use an own SMARTFORM for the e-mailText when a PO is sent to Vendor.
I just want to change the e-mail Text.
I set Parameter CV_SMARTFORM_MAIL
Everythign fine so far.
My problem:
How can I define own text formats within the body?
Every style or text format within my SMARTFORM is not used when EMAIL is sent to vendor.
Format seems to be RAW, even if I change the e-mail FORMAT within BAdI (using cs_parameters-mail_format) my e-mail does not accept any styles or Text formats.
Any ideas?
Thanks and regards
AndreasHi Andreas,
the format of the Mail Body is hardcoded set to RAW and so the Output of the Mail Body Smatrform is converted to plain text (displayed in Courier by the mail program you use for reading).
This happens in Method PROCESS_BBP_PO_MAI of class CL_PD_PO_PROCESSING_BBP which is per default customized as the processing class for PO output via email.
We haven't changed the Format of the mail Body but to do that you will have to copy that class into customer namespace, change the config with transaction BBP_PO_ACTION_DEF and change the Mail_format parameter in structure LS_PARAMETER to bbpex_conttype_html.
Hope that helps!
Cheers
Oliver -
Hi Experts,
I have a requirement , wherein I need to make certain word in my custom mail template( palin text) as bold or underline( or both) , I tried Mail template Macros FORMAT for this but it didnt work , If anyone knows how can we achieve this please share.
regards,
VIshal GoelHi Vishal,
Please try below format, so that it may work.
FORMAT("b", "Title:") %TOKEN1%
FORMAT("b", "Posted By:") %TOKEN2%
LINK("View Full Message", "%LINK123%")
The above mentioned will work only when HTML Mail option is selected on the user account level under Account properties.
Please let me know if the issue still exists.
Also Please go through the below link, it will be useful for you.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/001d645f-008f-3010-7b8f-e7935e46733a?overridelayout=true
Thanks,
Raj. -
Mail in attachment in text format
hi,
As per my requirement I need to send the errored records of file into mail in text format.
I have used the link to develop the code suggested by someone in sdn only to to so.
http://www.sapdevelopment.co.uk/reporting/email/attach_xlsmod.htm.
But now the problem is that the attatchment is in excel format.
But I want it in text format.
How to proceed?
Please help.
Thanks and Regards,
Smriti SinghHi,
here a short example like i do it:
* Mehr Beispile unter BCS_EXAMPLE_* mit se38
* Mehr Beispile unter BCS_TEST* mit se38
DATA: SEND_REQUEST TYPE REF TO CL_BCS.
DATA: SUBJECT TYPE SO_OBJ_DES.
DATA: ATT_TYPE TYPE SOODK-OBJTP.
DATA: IT_TEXT TYPE BCSY_TEXT.
DATA: WA_TEXT LIKE SOLI.
DATA: IT_BIN TYPE SOLIX_TAB.
DATA: WA_BIN TYPE SOLIX.
DATA: DOCUMENT TYPE REF TO CL_DOCUMENT_BCS.
DATA: SENDER TYPE REF TO CL_SAPUSER_BCS.
DATA: RECIPIENT TYPE REF TO IF_RECIPIENT_BCS.
DATA: BCS_EXCEPTION TYPE REF TO CX_BCS.
DATA: SENT_TO_ALL TYPE OS_BOOLEAN.
* Bytes der Datei
DATA: IT_LENGHT TYPE SO_OBJ_LEN.
DATA: N10(10) TYPE N.
START-OF-SELECTION.
PERFORM MAIN.
PERFORM RSCONN01_EXECUTE.
END-OF-SELECTION.
FORM MAIN.
TRY.
* Dokument erstellen (mit Anhang)
SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
PERFORM HEAD_CONT.
PERFORM RAW_ATT.
* Dokument (mit Anhang) setzen
CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
* Absender setzen
SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ).
CALL METHOD SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = SENDER.
* Empfänger setzen
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
'email@address' ).
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
* Dokument senden
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
COMMIT WORK.
* Sende-Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "main
FORM HEAD_CONT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Betreffzeile'.
WA_TEXT = 'First Line'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line'. APPEND WA_TEXT TO IT_TEXT.
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = ATT_TYPE
I_TEXT = IT_TEXT
I_LENGTH = IT_LENGHT
I_SUBJECT = SUBJECT ).
* Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "HEAD_CONT
*& Form RAW_ATT
* text
FORM RAW_ATT.
CLEAR: IT_TEXT[], WA_TEXT, SUBJECT.
ATT_TYPE = 'RAW'.
SUBJECT = 'Text Anhang'.
WA_TEXT = 'First Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
WA_TEXT = 'Second Line in ATT'. APPEND WA_TEXT TO IT_TEXT.
* Lenght of Att_Text
DESCRIBE TABLE IT_TEXT LINES N10.
N10 = ( N10 - 1 ) * 255 + STRLEN( WA_TEXT ).
IT_LENGHT = N10.
TRY.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = ATT_TYPE
I_ATT_CONTENT_TEXT = IT_TEXT
I_ATTACHMENT_SIZE = IT_LENGHT
I_ATTACHMENT_SUBJECT = SUBJECT.
* Error abfangen
CATCH CX_BCS INTO BCS_EXCEPTION.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), BCS_EXCEPTION->ERROR_TYPE.
EXIT.
ENDTRY.
ENDFORM. "ATT_RAW
*& Form RSCONN01_EXECUTE
* text
FORM RSCONN01_EXECUTE.
* Besser 2 Sekunden warten, damit alles versendet ist
WAIT UP TO 2 SECONDS.
SUBMIT RSCONN01 WITH MODE = 'INT'
WITH OUTPUT = ' '
AND RETURN.
ENDFORM. "RSCONN01_EXECUTE
See also the mentioned examples.
Hope it helps.
Regards, Dieter -
How to create reports of rich text format usuing oracle pl/sql - urgent
I want to generate reports of the format rich text format usuing pl/sql,So can any one help me out on this...
946903 wrote:
I want to generate reports of the format rich text format usuing pl/sql,So can any one help me out on this...There is no "urgent" here.
"Urgent" means one of two things -
1) people are dying, or
2) you have a customer-facing, revenue-producing production system that is down.
(And to get some perspective on the second case, keep the first in mind.)
For the first, you call whatever civil emergency service seems appropriate.
For the second, you open an SR with Oracle - which requires a paid-up support contract. For them to consider your problem "urgent", you will need to demonstrate that your problem falls under item #2. I seriously doubt your problem fits that criteria. -
I am Lion on Mac Book pro.
When I move a mail with attachement to a folder, sometimes, it loses its mime-type and becomes a text formatted message. Hence the contents of the attachments are added as text to the mail and I cannot download the attachments then.
This does not happen always, but almost 3/10 times.
Thanks.
Regards,
VirajWhat type of mail account is this (POP, IMAP, .Mac)? If IMAP or .Mac, what are your Preferences > Accounts > Mailbox Behaviors > Drafts settings?
Go to Apple Menu > System Preferences > Network, choose Network Port Configurations from the Show popup menu, and make sure that the configuration used to connect to Internet appears at the top of the list. Turn OFF all the port configurations except the one needed to connect to Internet and see whether that helps — if it doesn’t, turn ON again the ones you want enabled.
Open Keychain Access > Keychain First Aid and verify/repair the keychain.
Try also turning OFF the Search For Certificates options in Keychain Access > Preferences if any of them is ON — take a look at the following articles for more information on this particular issue:
http://www.hawkwings.net/2006/07/18/apple-mail-phones-home-too/
http://www.macgeekery.com/tips/mailapp_doesnt_phone_homeeither/ -
Text format problem when sending mails
Hi all,
I am using the FM SO_DOCUMENT_SEND_API1 to send mail in text format, but the problem now is iam getting the space between each characters and also for each lines the alignment differs. can any one tel me how to solve this issue ?
D o c u m e n t N o L o g D e s c r i p t i o n
4 5 0 0 0 0 1 4 1 0 PO d o n e f o r G o o d s r e c e i p t o f P O 4 5 0 0 0 0 1 4 1 0
4 5 0 0 0 0 1 4 1 1 PO d o n e f o r G o o d s r e c e i p t o f I n t e r C o P O 4 5 0 0 0 0 1 4 1 1
4 5 0 0 0 0 1 4 1 2 PO d o n e f o r G o o d s r e c e i p t o f I n t e r C o P O 4 5 0 0 0 0 1 4 1 2 .
Thanks.Hi Siva,
Seems problem with the types.Define following paramaters as shown below.
DATA: DOCDATA LIKE SODOCCHGI1 OCCURS 0,
OBJPACK LIKE SOPCKLSTI1 OCCURS 0,
OBJHEAD LIKE SOLISTI1 OCCURS 0,
L_OBJTXT1 TYPE SOLISTI1,
RECLIST TYPE SOMLRECI1,
DOC_CHNG TYPE SODOCCHGI1,
OBJPACK TYPE SOPCKLSTI1.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
PACKING_LIST = L_OBJPACK
OBJECT_HEADER = L_OBJHEAD
CONTENTS_BIN =
CONTENTS_TXT = L_OBJTXT
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
RECEIVERS = L_RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Ravinder -
Convert spool in the text format and send mail
Hi All
Can anyone tell me
how to convert the spool into the text format and send that in email as an attachment..
Points will be rewarded
URGENTHi,
Read spool using FM RSPO_RETURN_ABAP_SPOOLJOB
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
rqident = v_rqident "Spool Number
FIRST_LINE = 1
LAST_LINE =
TABLES
buffer = i_spool "Internal table output
You will get spool in internal table and then its your game, play the way you want.
Regards,
Mandeep -
How to strip text formatting from text field value ??
Hi everyone,
Have tried to get some info on this but no luck.... I've
created a simple contact form in Flash, but the URL which it's
generating contains the text formatting from the text input fields.
As a result the script that processes the mail send doesn't work.
How do I strip the text formatting out of text1, text2 and text3
before I use getURL() ??
on (release) {
url_var =
"your_name="+text1+"&your_e-mail="+text2+"&message="+text3;
getURL("contact.php?"+url_var, "_blank", "GET");
text1 = "";
text2 = "";
text3 = "";
}text1.text = "";
text2.text = "";
text3.text = "";
…that should strip the textfields. You probably also
want to add this property (text) in the getURL() -
Can't see HTML and Custom text format under data format tab in obiee.
Hi,
I want to add a java script to my report but I can't see HTML/Custom text format option under Data Format Tab--->"Treat Text as" menu.
My report is a union report.
For data column and numeric columns i can see custom option available but for text columns it is not visisble.
Any idea why it is not showing and what should be done here.
Any pointers are welcome.
Please help,it is really urgent.
Thank in advance!
Edited by: 810008 on May 18, 2011 10:03 PMHi,
Select text column (varchar column) -> Treat Text as -> custom text format ->Remove @ (default) -> add [html]<script>sometext(‘@’)</script> followed by your javascript
for eg:
[html]<script>buildGoogleChart(‘@’)</script> <head> <script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } </script> </head> <body> <input type="button" onclick="show_alert()" value="Show alert box" /> </body> </html>
hope helps u.........
cheers,
Aravind -
How to view my email in HTML format instead of Plain Text format?
I receive plenty of HTML format emails everyday.
but when I check those emails on iPhone, all emails were automatically converted to Plain Text format.
I wish to view my emails in HTML format (just as it shown in Outlook)
with graphic (jpep loaded, instead of attachment), and Text formatting.
Can anyone suggest me any solution?
or do Mail apps in iPhone does not support HTML format?
Pls guide.
Thx.To get a source code for jsp mail visit http://www.jspinsider.com/tutorials/jsp/javamail.view
-
Can anyone tell me why I am unable to download a template word doc from webmail onto my mac without it opening in text format? I just need the original document format.
Where to begin... and why would you ask here? (workstation owners)
Places I can think to try, after google of course....
Forum devoted to something like Word / Mactopia or Pages.... whether you are using Office 2011, and no idea what browser or webmail (IMAP, Gmail, other)
And then there really are notebook with subforum for MacBook Pro
Apple Site Map
Apple Support Mail
Apple Support -
Rejection Applicant: How to add plain text to the mail E Mail Letter?
Dear All:
I'm working with a ECC6 version.
In transaction PB60, when we do the candidate rejection activity, the E Mail letter generates a mail with empty body text, and an attachment with the letter in PDF format. The letter is OK, but I would like to know how to add some plain text to this E Mail letter. An empty mail is not a good practise.
I searched across the forums and SAP documentation, but I could not find any clue.
I would appreciate any help regarding to this matter.
Best regards
JordiHere you go ! ( you need to create Text in t-code SO10 for ID = PAML " )
Two Default texts under ID = PAML :
*MAIL-APP-INTERVIEW *EN TEXT PAML SYSTEM
MAIL-APPLICANT EN TEXT PAML SYSTEM
Personnel Management->Applicant Activities->Mail Connection ->Create standard texts for mail connection
Create standard texts for mail connection
In this step you can create the standard texts to be used in mails.
Example
u2022 Request for return of applicant file
u2022 Notification of date of job interview
Requirements
u2022 You should have assigned a standard text to the activity.
u2022 You should also have set the variables which are to be used.
u2022 Finally, you should also have made the settings for supplying the variable with values.
Standard settings
The standard system contains two examples of standard texts. You can use these examples as references to help you create your own standard texts. The standard texts have the following names:
u2022 MAIL-APPLICANT (note on an applicant activity)
u2022 MAIL-APP-INTERVIEW (note on appointment for interview)
Please note that the standard texts are stored under text ID PAML.
Activities
Now create the standard texts you require under text ID PAML.
Further notes
Every mail is made up of a heading and contents. In the first line of the standard text you enter the heading of the mail and from the second line on, the contents.
The standard default settings for style and layout are used for mails.
The SAP System treats standard texts as application data. This is why there is no automatic connection to the transport system. If you want to copy texts from one client to another within the same system, please use the functions of the transaction to create the texts. If you want to send the texts to a different system, please enter the transport manually as follows:
PgmID Obj Objectname
R3TR TEXT TEXT,XYZ,PAML,E
| | | --- Language (e.g. E for English)
| | -
Text ID (e.g. PAML for standard mails)
| -
Text name (probably not XYZ)
Text object (TEXT ist fixed)
Good luck
Saquib Khan
Maybe you are looking for
-
Tried everything... still no luck!
I know this has probably been posted nearly 500 times but I haven't found the answer yet! My last iPod's hard drive crashed so I got a new replacement last month or so. I've been trying ever since got it to get iTunes to display it as a source but it
-
Hi, i am facing a problem where memory card (8gb) are self removed randomly. It had to be remove from phone and insert back to be detected again or sometime just simply restart the phone to make it work again. It's quite hard to point out the problem
-
Create a MS-DOS java environment
thought i would post this for the benefit of others. its a dos batch file that creates a java environment in a new dos window (so u don't have to keep typing out file/tool paths all the time): @echo off rem ******* run Doskey -- rem ******* NOTE, NT/
-
Resource in Waiting status wiating for what?
Hi All, How can one tell what the resource is waiting for? Thanx Fred
-
Mac can't connect to exchange server
Hello everyone, I'm having an issue with our mail environment. Windows users and phone users (iOS and Android) are working But when I try to configure a Exchange mailbox it doesn't work. It says: Username and password is incorrect. Even with Domain i