Test sending mail 3

package sentmail; 

import java.text.SimpleDateFormat; 
import java.util.Date; 

public class Test { 
    public static void main(String[] args) { 
        String from = "[email protected]"; //Sender Email 
        String pass = "1"; 
        String rcpt = "[email protected]"; //Recipient Email 
        String server = "192.168.31.138"; // Server 

        String port = "25"; 
        Date date =new Date(); 
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 
        StringBuffer subject = new StringBuffer(); 
        subject.append("Java test mail" + sdf.format(date)); 
        Mail sentmail = new SendMail(from, pass, rcpt, server,port, subject.toString()); //Upward transformation
        sentmail.sentmail (); 
    } 
}


Guess you like

Origin blog.51cto.com/11732619/2677254