亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

用Java寫發(fā)送郵件的程序,經(jīng)常被當(dāng)做垃圾郵件處理怎么解決
PHPz
PHPz 2017-04-18 10:48:04
0
3
793
 sendMail(String receiver,String content){
       Properties properties=new Properties();
       properties.setProperty("mail.smtp.auth","true");
       properties.setProperty("mail.transport.protocol","smtp");
       properties.setProperty("mail.host","smtp.163.com");
       
       Session session =Session.getInstance(properties,new Authenticator(){
             protected PasswordAuthentication getPasswordAuthentication() {
             return new PasswordAuthentication("*********163.com","*******");
               }
          }
       );
      
      Message message=new MimeMessage(session);
try {
      message.setFrom(new InternetAddress("*********”@163.com"));
    } catch (AddressException e) {
      return "郵箱的登錄失敗,請檢查你的賬戶密碼是否正確!";
    } catch (MessagingException e) {
      return "你的賬戶異常,請重新發(fā)送!";
    }

try {
      message.addRecipients(RecipientType.TO,InternetAddress.parse(receiver));
      message.setSubject("MachineEye");
      message.setText(content);
    } catch (AddressException e1) {
      return "收件人賬戶信息不正確!";
    } catch (MessagingException e1) {
      return "收件人賬戶異常!";
    }
    
try {
      Transport.send(message);
    } catch (MessagingException e) {
      return "郵件發(fā)送失敗";
    }
return "發(fā)送成功!";
}
PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(3)
Ty80

....No matter what language you write in, if the legality and authority of your email address are not recognized, if your content is slightly wrong, or if someone reports you, it will easily end up in the spam mailbox.

迷茫

First of all, it has nothing to do with language.

1.. Declare the email address and header information (msg.Headers.Add("X-Mailer", "Microsoft Outlook Express 6.00.2900.2869"); put on the Outlook vest)

3. In special circumstances, some servers may still treat you as a spam mailbox after you have put on a legal vest, such as NetEase. This is because your email content may contain some sensitive words or illegal information. of.

阿神

Looking at phpmailer, I remember to set something up, it seems to be some kind of SASL authentication mechanism, but I don’t know anything else

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template