2016-07-30 7 views
3

내 응용 프로그램에서 전자 메일을 보내려고합니다. 코드가 오류없이 성공적으로 실행됩니다. 그러나 이메일을 보내지 않습니다. 콘솔에이 메시지가 표시됩니다.python에서 이메일 보내기 webapp2 Google App Engine

You are not currently sending out real email. 
If you have sendmail installed you can use it by using the 
server with --enable_sendmail 

구글에서 제공하는 샘플 코드는 다음과 같습니다

기본적으로 dev_appserver 실제 메일을 전송하지 않기 때문이다
message = mail.EmailMessage(
        sender="[email protected]", 
        subject="Your account has been approved") 

message.to = "ABC <[email protected]>" 
message.body = """Dear Albert: 
Your example.com account has been approved. You can now visit 
http://www.example.com/ and sign in using your Google Account to 
access new features. 
Please let us know if you have any questions. 
The example.com Team 
""" 
message.send() 

답변

0

.

이메일은 라이브 서버를 누르면 예를 들어, 작동 을 보내 : 당신은 센드 메일이 설치되어있는 경우

appcfg update /path/to/app/ 

그러나 오류 메시지가 지적처럼, 당신이해야

--enable_sendmail 플래그를 사용하는 시스템 또는 SMTP를 사용 플래그에, 예를 들어

dev_appserver /path/to/app/ --enable_sendmail=yes 

또는 SMTP 공급자로 또 다른 예를 들어, 사용의 Gmail

dev_appserver /path/to/app --smtp_host=smtp.gmail.com --smtp_port=465 \ 
[email protected] --smtp_password=password 
여기

더 설명 : https://cloud.google.com/appengine/docs/python/mail/

메일 및 개발 서버가 앱의 기능을 테스트 할 때 컴퓨터에서 직접 를 전자 메일 메시지를 보내도록 구성 할 수 있습니다

개발 서버 그 은 메시지를 보냅니다. 선택한 서버의 SMTP 서버를 사용하도록 개발 서버를 구성 할 수 있습니다. 또는 Sendmail이 컴퓨터에 설치되어 있고 전자 메일을 보내도록 설정되어있는 경우 개발 서버에 Sendmail을 사용한다고 알릴 수 있습니다.

응용 프로그램이 메일 서비스를 호출 할 때 SMTP 서버를 구성하거나 Sendmail을 활성화하지 않으면 개발 서버는 메시지 내용을 기록합니다. 메시지는 실제로 전송되지 않습니다.