Hi,
I tried using the java mail api to send emails, the program compiles fine, but I dont receive any emails, maybe someone can help,
Heres part of the code, thx in advance
Code:public void actionPerformed(ActionEvent evt) { if(evt.getSource()==send) { to.setText("IT WORX"); String msg_recip = "setec@eircom.net"; String msg_subject = "test email"; String msg_body = "test"; Message mesg; Session session; Properties props = new Properties(); props.put("mail.eircom.net", "www.eircom.net"); session = Session.getDefaultInstance(props, null); session.setDebug(true); try { mesg = new MimeMessage(session); mesg.setFrom(new InternetAddress("setec@eircom.net")); InternetAddress toAddress = new InternetAddress(msg_recip); mesg.addRecipient(Message.RecipientType.TO, toAddress); mesg.setSubject(msg_subject); mesg.setText(msg_body); Transport.send(mesg); } catch (MessagingException ex){ while((ex = (MessagingException)ex.getNextException()) != null){ ex.printStackTrace(); } }


Reply With Quote


Bookmarks