Hi,
I am trying to use JavaMail to enable sending and receiving mails from my application. First of all I am not able to understand the basics of JAF (Javabeans Activation Framework) and why do we need it for JavaMail. Could someone please leave a line or two on this. Another thing I could not understand is java.mail.Session class. A session just contains some connection properties. What do they mean when they say a shared session which can be shared by other desktop applications also? I believe Transport is the real class that is doing the work of connecting and sending messages.
Now I am using the following code to send my mail. But although I am providing authentication, I get a 530 authentication required error on the console. Here is a small section of the code:
Transport tr = session.getTransport("smtp");
tr.connect(mxServer, mxUsername, mxPassword);
msg.saveChanges();
tr.sendMessage(msg, msg.getAllRecipients()); //--error line
tr.close();
I get a 530 error on the error line. I have set the appropriate message fields. I am using "smtp.mail.yahoo.com" as the smtp host with my authentication.
Could someone please answer my questions? Thanks in advance.
Samit
I am trying to use JavaMail to enable sending and receiving mails from my application. First of all I am not able to understand the basics of JAF (Javabeans Activation Framework) and why do we need it for JavaMail. Could someone please leave a line or two on this. Another thing I could not understand is java.mail.Session class. A session just contains some connection properties. What do they mean when they say a shared session which can be shared by other desktop applications also? I believe Transport is the real class that is doing the work of connecting and sending messages.
Now I am using the following code to send my mail. But although I am providing authentication, I get a 530 authentication required error on the console. Here is a small section of the code:
Transport tr = session.getTransport("smtp");
tr.connect(mxServer, mxUsername, mxPassword);
msg.saveChanges();
tr.sendMessage(msg, msg.getAllRecipients()); //--error line
tr.close();
I get a 530 error on the error line. I have set the appropriate message fields. I am using "smtp.mail.yahoo.com" as the smtp host with my authentication.
Could someone please answer my questions? Thanks in advance.
Samit