hi,
"Below shown is a code written for send a mail using
java mail API concept, Can anyone tell why iam getting error as shown below"
import javax.mail.*;//error here
import javax.mail.internet.*;//error here
public class Abhi1 {
public static void main(
String[] args) throws Exception {
String host = "smtp.mydomain.com";
String from = "me@myweb.com";
String to = "you@myweb.com ";
Properties prop = System.getProperties();
prop.put("mail.smtp.host",host);
Session sess1 = Session.getDefaultInstance(prop,null);
Mimemessage msg = new MimeMessage(sess1);
msg.setFrom(new InternetAddress(from));
msg.addRecipient(Message.RecipientType.To,new InternetAddress(to));
msg.setText("you won the lotri");
Transport.send(msg