 |
|
 |
I am reading mail content using javamail only. I may get mail from "HTML", "RTF" or "Plain text format.If i am getting mail in "RTF" format, i need to show that in RTF format.(Ex: if we have table in mail, should show same table structure with content). If i am getting mail from HTML format, i need to show that in "HTML" format(Ex: if i have any hyperlink, it should display as link. if i have any table, should show in table format. Presently, If i am getting mail as HTML format, read mail showing in the applicationlike, "testing for value testing...." I need to show in html format.
hel pme please 
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
Check the content and use this appropriate MimeMultipart content = new MimeMultipart("alternative"); MimeBodyPart text = new MimeBodyPart(); MimeBodyPart html = new MimeBodyPart(); text.setText( "Your text content" ); text.setHeader("MIME-Version" , "1.0" ); text.setHeader("Content-Type" , text.getContentType() ); html.setContent("Your html content", "text/html"); html.setHeader("MIME-Version" , "1.0" ); html.setHeader("Content-Type" , html.getContentType() );
content.addBodyPart(text); content.addBodyPart(html); message.setContent( content ) message.setHeader("MIME-Version" , "1.0" ); message.setHeader("Content-Type" , content.getContentType() ); message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
Hope this helps,
- Mohashar
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i wanna ask abt what u actually need to do to send an Email using java code that u gave. the code that is here i got an error in this line org.xbill.DNS.Record arecord[] = (new Lookup(smtphost, (short)15)).run(); what is it. like can we just easily send email just writing these lines in our app.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If you would have given valid smtphost then it will not give any error. This is a simple program which gives some idea about java mail. This not meant for intermediate/higher level java programmars.
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
When we create logger object.It is locked.If requrinment is to read lines of logger file and create new automaticaly how can we do
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I think you can read the stream. i.e., read the characters while creating a file.
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi,
I did as per instructions, i downloaded your test application but i m getting this error: Initializaiton Block = Null. It goes into the catch loop at
org.xbill.DNS.Record arecord[] = (new Lookup(smtphost, (short)15)).run(); // Store all SMTP hosts and their Priority for(int j = 0; j < arecord.length; j++) it is getting null at the length!!!!
Then i tried to modify the code, by removing the above FOR loop and made the adjustemnts, so that i have only one smtphost...i hardcoded the IP address(i have confirmed that this is indeed the correct ip address) But now i am getting the error: Error in sending Address Try.........Invalid Addresses; nested exception is:class com.sun.mail.smtp.SMTPAddressFailedException: 554 Relay rejected for policy reasons. This time it goes into catch at : Transport.send(mimemessage); I checked, it is when i use the "cc". If i comment the cc part, then it runs successfully
I am using: Eclipse SDK Version: 3.1.2 Build id: M20060118-1600 JDK1.5.0
Any help will be greatly appreciated!!!!
-- modified at 13:08 Wednesday 22nd August, 2007
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
i follow all steps but in running i get this exception
Mailing Process Started ............ strPriority=[10];strHostName=[smtp3.google.com.] strPriority=[10];strHostName=[smtp4.google.com.] strPriority=[10];strHostName=[smtp1.google.com.] strPriority=[10];strHostName=[smtp2.google.com.] Error in sending Address Try.........Could not connect to SMTP host: smtp3.google.com., port: 25; nested exception is: java.net.ConnectException: Connection timed out: connect Mailing Process Ended ............
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Seems smtp server connect problems..Try this to checkthe smtp connection Hi, your smtp server is not relaying to the gmail server...you can check this using these steps Take cmd prompt 1. c:> telnet smtp_servername 25 2. helo 3. mail from: xxx@xx.com 4. rcpt to: xxx@gmail.com 5. data test mail . Do the above steps one bye one Hope this helps
Cheers, Mohashar
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi. Thanks for the great tutorial. I have a problem, however. I code in java servlets using smtpClient class to send mails, but am unable to send mails to outside servers(eg. gmail.com). the mailing list software however can send mails to all hosts. Please find time to answer this soon. Thanks and regards
Rudraxi Parashar
|
| Sign In·View Thread·PermaLink | 1.00/5 (3 votes) |
|
|
|
 |
|
 |
Hi, your smtp server is not relaying to the gmail server...you can check this using these steps Take cmd prompt 1. c:> telnet smtp_servername 25 2. helo 3. mail from: xxx@xx.com 4. rcpt to: xxx@gmail.com 5. data test mail . Do the above steps one bye one Hope this helps
Cheers, Mohashar
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello, I m getting Initialization Block.......null exception while running program on eclipse version 3.2.......i read that there is suggestion of using weblogic.jar file....but i am working on tomcat. So, plz reply what should i have to do????????????????????
plz reply its very urgent.....
Gitanjali Dua
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It doesnot matter which web server you are using. It's a matter of mail api's are there in classpath. Pls check the required jars are in the classpath.
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello, I m getting Initialization Block.......null exception while running program on eclipse version 3.2.......i read that there is suggestion of using weblogic.jar file.... but from where should i get it???? plz reply its very urgent.....
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
This is due to reference problem. You don't have appropriate jars then put weblogic.jar in the classpath and try it.
If you have weblogic you can get it from lib folder.
Rgs, Ashraf Mohamed
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
here am getting these exception when am running the sendmail.java Invalid address i checked out classpath for jar files everything s correct
am using 1st smtp server downloaded frm web i dont know y it is not working very urgent
plzzzzzzzzz reply me
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
Have you checked the smtp host name using telnet? Please check the smtp hostname is exist using following command
telnet smtpservername portnumber
If you still facing this problem send me the exception.
Hope ths helps.
Rgs Mohashar
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I have implemented the same logic into my test program. Its working fine for the correct email addresses, but if I put email address as abc@xyz.com, then also its sending. though no reciept msg is coming even then no exception is there.
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Unless until you handle the bounce using pop3 it will not be showing any receipt of the message.
SMTP is not a point to point type protocol.It simply delivers it and bounced message must be captured by pop mechanisms.
Hope this helps...
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Sending the mail i can set many attachments but the text of the mail is not displayed.
i mean the text like:
Subject: dinner
text: where we meet?
if i add an attachment to the mail "where we meet" is not displayed. but i f i don't attach nothing the text is showed.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You meant to say, if you add an attachment you are not able to see the body right. Please check the attachment part overwrite the body content.
visit www.mohamedashraf.tk
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
hi,
I got the following error if i run my code.
javax.mail.MessagingException: IOException while sending message; nested exception is: java.io.IOException: No content.
please help me.
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |