当前位置: 代码迷 >> Java Web开发 >> javamail smtp.sina.com.cn 的连接有关问题
  详细解决方案

javamail smtp.sina.com.cn 的连接有关问题

热度:995   发布时间:2016-04-17 12:31:18.0
javamail smtp.sina.com.cn 的连接问题
我刚刚注册的一个 sina 的邮箱。 


想要实现发送邮件的功能, 可是一直都连接不上, 
代码如下: 
  try { 
  Properties props = new Properties(); 
  props.put("mail.smtp.host", mailserver);  
  props.put("mail.smtp.auth", "true");  
  Session session = Session.getDefaultInstance(props, 
  new Authenticator() { 
  public PasswordAuthentication getPasswordAuthentication() { 
  return new PasswordAuthentication(user, password); 
  } 
  } 
  ); 
  Message msg = new MimeMessage(session); 
  msg.setFrom(new InternetAddress(fromAddr)); 
  InternetAddress[] tos = InternetAddress.parse(toAddr); 
  msg.setRecipients(Message.RecipientType.TO, tos); 
  msg.setSubject(subject); 
  Transport.send(msg); 
  System.out.println("Mail is Sent"); 
  } 
  catch (Exception e) { 
  System.out.println(e); 
  } 

  } 

我就想知道 用什么邮箱能好使。现在都找不到一个好使的邮箱 


用什么邮箱能刚一注册就能用 

qq 我试过了 得等到15天之后呢
试过很多了 都不好用



------解决方案--------------------
163的好使
我用过
------解决方案--------------------
给你发信了 问题在里边说清楚了
  相关解决方案