Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9266571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:21:00+00:00 2026-06-18T14:21:00+00:00

I have developed a spring Java Mail application in my project.I have configured my

  • 0

I have developed a spring Java Mail application in my project.I have configured my company mail server name in Spring.xml file. I am using JavaMailSenderImpl.

My spring.xml

<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> 
 <property name="host" value="smtp.mycomp.com"/> 
</bean>

in my java class

public class ServiceEmail {

           public JavaMailSender getMailSender() {
            return mailSender;
        }

        @Autowired
        @Required
        public void setMailSender(JavaMailSender mailSender) {
            this.mailSender = mailSender;

             message.setTo("example@gmail.com");
         message.setFrom(fromEmailAddress);

             try{
                this.mailSender.send(preparator);
               }catch(MailException e){

                   e.printstacktrac();

}
}

}

But when I use this I am not able to send any mails to gmail or any other mail cllients it’s failing with relaying denied exception. But it’s working well with my internal server.Is it my mail server Issue or Do i need to configure for each and every email client.How can configure this to work all the mail clients.Can I configure in XML file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:21:01+00:00Added an answer on June 18, 2026 at 2:21 pm

    This JavaMail FAQ entry should help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a Email service using Spring Java mail and Velocity Template like
I have a web application developed using Java (Java EE), spring & Hibernate. We
I have developed a Java server using Eclipse that accepts TCP socket connection from
I have developed demo application using spring struct and hibernate and getting following error
I have developed Flex - Java - Spring Web Application that I have deployed
I have developed a web application using Spring 3.1 In one of the module
I have developed a spring application, I want to configure it with apache log4j,
I have a web application developed with Spring 2.5. The application has numerous controllers,
I have used spring framework 3 for my application. Everything is ok while developed
I have a web application developed with Struts2, JSP, JPA, Spring and MySql. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.