Error in sending mail javax.mail.NoSuchProviderException: No provider for smtp.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, May 4, 2001 10:04 AM

The above error message comes in my application server. I have used java mail api in this program. This is the source code i have used. package sendmail; import javax.mail.*; import javax.mail.internet.*; public class SendMail extends Thread{ String userid; String password; String tomailid; String frommailid="jobcentreuk.com"; String mailsubject="JOB CENTRE Registration ...."; String content; public SendMail(String userid,String password,String tomailid){ this.userid=userid.replace(' ','%'); this.password=password; this.tomailid=tomailid; content=&q   More>>

The above error message comes in my application server. I have used java mail api in this program. This is the source code i have used.

package sendmail;

import javax.mail.*;
import javax.mail.internet.*;





public class SendMail extends Thread{

String userid;
String password;

String tomailid;

String frommailid="jobcentreuk.com";

String mailsubject="JOB CENTRE Registration ....";
String content;


public SendMail(String userid,String password,String tomailid){

this.userid=userid.replace(' ','%');
this.password=password;
this.tomailid=tomailid;


content="Welcome to jobcentreuk.com

";
content=content+" Your Login Name : "+userid+"
";
content=content+" Your Password : "+password+ "
";

content=content+"Thankyou for signing up at www.jobcentreuk.com";

start();

}


public void run(){

try{

java.util.Properties properties=System.getProperties();
Session sess=Session.getInstance(properties,null);
MimeMessage message =new MimeMessage(sess);

Address fromaddress=new InternetAddress(frommailid);
message.setFrom(fromaddress);

Address[] toaddresses =InternetAddress.parse(tomailid);
message.setRecipients(Message.RecipientType.TO,toaddresses);

message.setText(content);
message.setSubject("jobcentre Registration Confirmation");

Transport transport = sess.getTransport("smtp");

// get smtp name here
//transport.connect("md3.vsnl.net.in"," ", " ");
transport.connect("imi.demon.co.uk"," ", " ");


transport.sendMessage(message,message.getAllRecipients());
transport.close();


}catch(Exception e){
System.out.println("Error in Sending Mail "+e);
}
}

}




I think the problem is the smtp service name. This is dedicated server provider smtp address.

Is there any free smtp server available.

my dedicated server provider smtp address is

POST.demon.co.uk

my office smtp address is

imi.demon.co.uk

Kindily give the solution please.

with thanks,

kailash Shankar.

   <<Less

Re: Error in sending mail javax.mail.NoSuchProviderException: No provider for smtp.

Posted By:   John_Zukowski  
Posted On:   Saturday, May 5, 2001 09:21 AM

Sun's reference implementation comes with an SMTP provider. It is free.

Re: Error in sending mail javax.mail.NoSuchProviderException: No provider for smtp.

Posted By:   Michael_Wax  
Posted On:   Friday, May 4, 2001 12:48 PM

A NoSuchProviderException is thrown if a Provider class, as defined in the javamail.providers resource file, is not found. Do you have this file set up?
About | Sitemap | Contact