2013-10-28 5 views
0

메일러 0.8.1을 사용하고 다트 랭으로 메일을 보내기 위해 데모 어플리케이션을 만들려고했지만 작동하지 않습니다. 이 내 코드 :다트 메일러가 메일을 보내지 않음

var options = new GmailSmtpOptions() 
    ..username = 'my gmail account' 
    ..password = 'my gmail pass'; 
    var emailTransport = new SmtpTransport(options); 

    var envelope = new Envelope() 
    ..from = '[email protected]' 
    ..recipients.add('[email protected]') 
    ..subject = 'Testing mailer'  
    ..text = 'This is test mailer' 
    ..html = '<h1>Test send mail</p>'; 

    .then((success) => print('Email sent! $success')) 
    .catchError((e) => print('Error occured: $e')); 

하지만 난 응용 프로그램을 실행할 때 아무것도 인쇄되지 않습니다. 누군가 나를 도울 수 있습니까? thanks1

답변

0

아직이 패키지를 사용하지 않은하지만 당신이 SmtpTransport를 사용해야 자체가 메일을 보낼 수 없습니다 .then()/.catchError()

0

봉투에 성공 리드에서와 일부 send 전화를 누락 보인다 그 :

emailTransport.send(envelope) 
     .then((_) => print('Email sent!))) 
     .catchError((e) => print('Error occurred: $e')); 
관련 문제