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

  • SEARCH
  • Home
  • 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 8220477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:31:51+00:00 2026-06-07T13:31:51+00:00

What happened? Previously worked ok, but now gives an error. public Send(String user, String

  • 0

What happened? Previously worked ok, but now gives an error.

 public Send(String user, String password) 
    {   
        this.user = user;   
        this.password = password;   
        Properties props = new Properties();   
        props.setProperty("mail.transport.protocol", "smtp");   
        props.setProperty("mail.host", mailhost);   
        props.put("mail.smtp.auth", "true");   
        props.put("mail.smtp.port", "465");   
        props.put("mail.smtp.socketFactory.port", "465");   
        props.put("mail.smtp.so cketFactory.class","javax.net.ssl.SSLSocketFactory");   
        props.put("mail.smtp.socketFactory.fallback", "false");   
        props.setProperty("mail.smtp.quitwait", "false"); 
        session = Session.getDefaultInstance(props, this);
    }

    protected PasswordAuthentication getPasswordAuthentication() 
    {   
        return new PasswordAuthentication(user, password);
    }   

public void sendMail (final String recipients, final String FileName) 
    {
        Thread SendThread = new Thread() 
        { 
            public void run() 
            {                   
                try
                {               
                    //String SSS = FileName.replace("+", "");                   
                    //String Fname = new File (SSS).getName();

                    String Fname = new File (FileName).getName();
                    String subject = Fname.substring(0, 9);     
                    Log.e("!!!!!!!!!!!!!!!!!!!!!! ", Fname);

                    String RusFname = new String (Fname.getBytes());
                    String sender = "_X_X_X_";
                    MimeMessage message = new MimeMessage(session);   
                    message.setSender(new InternetAddress(sender));
                    message.setSubject(subject);            
                    MimeBodyPart attachmentPart = new MimeBodyPart();                       
                    FileDataSource fileDataSource = new FileDataSource(FileName) 
                    {
                        @Override
                        public String getContentType() 
                        {
                            return "application/octet-stream";
                        }
                    };
                    attachmentPart.setDataHandler(new DataHandler(fileDataSource));                             
                    attachmentPart.setFileName(MimeUtility.encodeText(RusFname));               
                    Multipart multipart = new MimeMultipart();
                    multipart.addBodyPart(attachmentPart);            
                    message.setContent(multipart);           
                    if (recipients.indexOf(',') > 0) 
                        message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));   
                    else  
                        message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));   
                    Transport.send(message);
                    File f = new File(FileName);
                    Log.e("!!!!!!!!!!!!!!!!!!!!!! ", "Sended");
                    f.delete();                 
                }
                catch (MessagingException ex)   
                {  
                    ex.printStackTrace();  
                } catch (UnsupportedEncodingException e)
                {
                    e.printStackTrace();
                }
            }
        };
        SendThread.start();
    }
07-15 15:32:31.849: WARN/System.err(10287): javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
07-15 15:32:31.849: WARN/System.err(10287):     at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1379)
07-15 15:32:31.849: WARN/System.err(10287):     at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
07-15 15:32:31.849: WARN/System.err(10287):     at javax.mail.Service.connect(Service.java:310)
07-15 15:32:31.854: WARN/System.err(10287):     at javax.mail.Service.connect(Service.java:169)
  • 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-07T13:31:52+00:00Added an answer on June 7, 2026 at 1:31 pm

    It looks like connection error… please check your network status, firewalls etc.

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

Sidebar

Related Questions

This has happened before to me, but I can't remember how I fixed it.
This is a complicated situation, but essentially what has happened here is that our
Interesting happened to me... I have a grid with rows of data, but the
Has this happened to anyone? Nothing has changed on my system, yet TFS no
Previously, I could build projects and launch the sites..but suddenly, it stopped building and
I'm not sure what happened, but my installer is in a weird state--when I
I have some problem with my JSystem/Java/Eclipse enviromment. I get this error and i
I'm not sure if something odd is happening or if this is normal, but
This happened without me changing anything except upgrading to 3.2.1 2 weeks ago. in
What happened is that we have a page that was previously working then all

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.