transport.connect("smtp.qq.com "," test "," test ");
妳在qq.com使用smtp服務,但妳試圖發送字符串strFrom="test@sohu.com”;搜狐網郵箱,so提示501郵件發件人地址必須與授權用戶相同,即妳的郵箱地址與SMTP驗證的用戶名不對應,字符串strFrom="test@qq.com“或
props.put("mail.smtp.host "," SMTP . Sohu . com ");
transport . connect(" SMTP . Sohu . com "," test "," test ");