当前位置: > 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 {
x05x05Properties props = new Properties();
x05x05props.setProperty("mail.debug","");
x05x05Session session = Session.getInstance(props);
x05x05Message msg = new MimeMessage(session);
x05x05msg.setText("你好吗?");
x05x05msg.setFrom(new InternetAddress("meimei@sohu.com"));
x05x05Transport transport = session.getTransport();
x05x05transport.connect("smtp.sohu.com",25,"wstc","123456");
x05x05transport.send(msg,new Address[](new InternetAddress("wstc@sohu.com")));
x05x05transport.close();
x05}
}

提问时间:2021-03-31

答案
Address[](new InternetAddress("wstc@sohu.com"))-->
Address[]{new InternetAddress("wstc@sohu.com")}
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.