 |
|
 |
hi sir following error when i run program...
and how to set class path.... for mail.jar,activation.jar etc...
D:\java\Java_Mail_demozip
D:\java\Java_Mail_demozip>javac SendMail.java
Note: SendMail.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D:\java\Java_Mail_demozip>java SendMail
Exception in thread "main" java.lang.NoSuchMethodError: main
please help me
|
|
|
|
 |
|
 |
Hi
I have put all the required jar files in the classpath but find the above error when running your code. Is this error due to SMTP host name as I find that 'arecord' value returns null. can you please help?
|
|
|
|
 |
|
 |
Hi
I am reading mail using java mail API and its content type is text/html and showing transfer-content type as Quoted-printable or Base64. As i need to fetch some information from mail but due to these transfer content type i am getting some unwanted text also like "=20" etc. Please tell me how to decode Quoted printable as well as Base64 message.
Thanks and Regards,
Shikha Virmani
|
|
|
|
 |
|
 |
This may help you
http://stackoverflow.com/questions/2764504/getting-base64-content-string-of-an-image-from-a-mimepart-in-java
visit www.mohamedashraf.tk
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
I think you can read the stream. i.e., read the characters while creating a file.
visit www.mohamedashraf.tk
|
|
|
|
 |
|
 |
How to solve this problem ?
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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 ............
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
help please !!!!
Lghj
oojk;j
|
|
|
|
 |
|
 |
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.....
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |
|
 |
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
|
|
|
|
 |