new Address[]()那里报The left-hand side of an assignment must be a variable错误、

new Address[]()那里报The left-hand side of an assignment must be a variable错误、
package com.sxt.mail;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailConnection {
\x05public static void main(String[] args) throws Exception {
\x05\x05Properties props = new Properties();
\x05\x05props.setProperty("mail.debug","");
\x05\x05Session session = Session.getInstance(props);
\x05\x05Message msg = new MimeMessage(session);
\x05\x05msg.setText("你好吗?");
\x05\x05msg.setFrom(new InternetAddress("meimei@sohu.com"));
\x05\x05Transport transport = session.getTransport();
\x05\x05transport.connect("smtp.sohu.com",25,"wstc","123456");
\x05\x05transport.send(msg,new Address[](new InternetAddress("wstc@sohu.com")));
\x05\x05transport.close();
\x05}
}
其他人气:254 ℃时间:2020-09-20 17:09:21
优质解答
Address[](new InternetAddress("wstc@sohu.com"))-->
Address[]{new InternetAddress("wstc@sohu.com")}
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版