简体   繁体   English

无法将邮件发送到python gae中的组

[英]not able to send mail to group in python gae

I want to send mail to the group. 我想向小组发送邮件。 But Mail API is not sending to group id. 但是Mail API不会发送到组ID。

Here is my code 这是我的代码

from google.appengine.api import mail
import traceback
class Mail:    
    # mail with html content    
    def send(self,emailFrom,emailTo,emailSubject,emailBody,emailHtml):
        try:
            logging.info("Mail From : " + emailFrom)
            message = mail.EmailMessage(sender=emailFrom,
                            subject=emailSubject)
            message.to = emailTo

            message.body = emailBody
            message.html = emailHtml
            result = message.send()
            logging.info("Mail Sent. To : " + emailTo + ' Subject : '+emailSubject)
            return "EmailSent"
        except Exception, err:
            logging.info("Unable to send email to " + emailTo + " : " + traceback.format_exc())
            return "ErrorInSendingEmail"

this is not showing any error on developer console logging. 这在开发人员控制台日志记录中未显示任何错误。

Are you able to send mails to individual ids? 您可以将邮件发送到个人ID吗? If yes and if the group is a internal group, which is exclusive to your organisation,you might want to check the google group settings and see if it has permissions to accept mails from external mail ids(mail ids which do not end with @yourorg.com) 如果是,并且该组是组织内部的内部组,那么您可能要检查google组的设置,并查看其是否具有接受来自外部邮件ID(不以@yourorg结尾的邮件ID)的权限.com)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM