Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java API
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
A Functional Approach to Java: Augmenting Object-Oriented Java Code with Functional Principles
this week in the
Functional programming
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Liutauras Vilda
Ron McLeod
Jeanne Boyarsky
Paul Clapham
Sheriffs:
Junilu Lacar
Tim Cooke
Saloon Keepers:
Carey Brown
Stephan van Hulst
Tim Holloway
Peter Rooke
Himai Minh
Bartenders:
Piet Souris
Mikalai Zaikin
Forum:
Other JSE/JEE APIs
SMTPSendFailedException Occurs
Balachandar Nayak
Greenhorn
Posts: 29
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I have a problem while executing this program.
import javax.mail.*; import javax.mail.internet.*; import java.util.Properties; class SimpleMail { public static void main(String[] args) throws Exception{ Properties props = new Properties(); props.setProperty("mail.transport.protocol", "smtp"); props.setProperty("mail.host", "mail.stras.com"); props.setProperty("mail.user", "jim@stras.com"); props.setProperty("mail.password", "12121"); props.setProperty("mail.smtp.port","25"); props.setProperty("mail.smtp.auth", "true"); Session mailSession = Session.getDefaultInstance(props, null); Transport transport = mailSession.getTransport(); MimeMessage message = new MimeMessage(mailSession); message.setContent("This is a test", "text/plain"); message.addRecipient(Message.RecipientType.TO, new InternetAddress("aru@stras.com")); transport.connect(); transport.sendMessage(message, message.getRecipients(Message.RecipientType.TO)); transport.close(); } }
This program compiles fine (no error) but while execution of this prg throws an error
com.sun.mail.smtp.SMTPSendFailedException: 530 Authentication required
Regards
Bala
Seetesh Hindlekar
Ranch Hand
Posts: 244
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
try
props.setProperty("mail.user", "jim");
instead of
props.setProperty("mail.user", "jim@stras.com");
Ensure that port 25 is not blocked.
rgds,
Seetesh
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Sending MAIL by Java
Program to send Email using JavaMail not working.
Exception while sending email from a Servlet
Java Mail query
Java Mail Problem
More...