メール送信のテスト3

package sentmail; 

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

public class Test { 
    public static void main(String [] args){ 
        String from = "[email protected]"; //送信者メール
        文字列pass = "1"; 
        String rcpt = "[email protected]"; //受信者のEメール
        文字列server = "192.168.31.138"; //サーバー

        文字列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()); //上向きの変換
        sentmail.sentmail(); 
    } 
}


おすすめ

転載: blog.51cto.com/11732619/2677254