Results 1 to 6 of 6
Thread: Java Mail - Need help
- 09-29-2011, 05:58 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 63
- Rep Power
- 0
Java Mail - Need help
Hi, I am trying to program my app to send an e-mail to a user containing his password. Here is the code I am using but for some reason it doesn't work. If you could please enlighten me on my errors.
Java Code:Properties props = new Properties(); props.put("mail.smtp.host", "msn.com"); props.put("mail.from", "example@msn.com"); Session session = Session.getInstance(props, null); MimeMessage msg = new MimeMessage(session); msg.setFrom(); msg.setRecipients(Message.RecipientType.TO, "example2@msn.com"); msg.setSubject("JavaMail hello world example"); msg.setSentDate(new Date()); msg.setText("Hello, world!\n"); Transport.send(msg);
- 10-01-2011, 08:12 AM #2
Member
- Join Date
- Feb 2011
- Posts
- 63
- Rep Power
- 0
Re: Java Mail - Need help
anyone at all?
- 10-01-2011, 08:40 AM #3
Re: Java Mail - Need help
You forgot about port and do you have exceptions when you run this code?
Skype: petrarsentev
http://TrackStudio.com
- 10-01-2011, 06:10 PM #4
Member
- Join Date
- Feb 2011
- Posts
- 63
- Rep Power
- 0
Re: Java Mail - Need help
no exceptions or errors, except it doesn't work.
what about
how do i find correct info that goes here?Java Code:props.put("mail.smtp.host", "msn.com"); props.put("mail.from", "example@msn.com");
- 10-02-2011, 08:36 AM #5
Re: Java Mail - Need help
Can you show all code, because I have confuse how you run it.
Skype: petrarsentev
http://TrackStudio.com
- 10-03-2011, 04:07 PM #6
Member
- Join Date
- Feb 2011
- Posts
- 63
- Rep Power
- 0
Similar Threads
-
send mail via java without java mail API
By majidvadoostan in forum NetworkingReplies: 2Last Post: 04-26-2011, 09:30 PM -
problem with sending mail usin javaX.mail api
By sandeepsai39 in forum New To JavaReplies: 4Last Post: 11-25-2009, 05:37 AM -
How to identify received mail is failure delivery notice mail in javamail?
By satheeshtech in forum Advanced JavaReplies: 2Last Post: 07-25-2009, 09:36 AM -
Attachments were missing when mail was sent through java mail API
By Malathi in forum Web FrameworksReplies: 2Last Post: 06-04-2009, 01:42 PM -
Javax.mail.MethodNotSupported Exception in java mail api
By namarc in forum Advanced JavaReplies: 2Last Post: 05-05-2008, 06:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks