using docmd to receive queue-id of a mail from smtp server

核能气质少年 提交于 2019-12-13 04:13:16

问题


I have written a code in jython 2.5, which uses the smtplib sendmail to send mail over a smtp server. Below is a simple snippet of the code

        mail = MIMEMultipart('mixed')
    mail['Subject'] = mail_subject
    mail['FROM']=UstrSender
    mail['To']=UstrReceivers
    mail['Cc']=UstrCC
    mail_p2=MIMEText(mail_html, 'html', 'utf-8')
    mail.attach(mail_p2)

    #Connection to SMTP
    #Enter SMTP Server Details, In case your server do require authentication modify authentication parameter below and uncomment
    s = smtplib.SMTP(smtpserver)
    #s.sendmail(UstrSender, [UstrReceivers, UstrCC], mail.as_string())
    sendmail_return = s.sendmail(UstrSender, [UstrReceivers, UstrCC], mail.as_string())

Now, the smtp server mentioned is a cluster of 3 individual servers and there is a lag at times on one of these servers because of a long queue of requests. To identify such issues and the culprit server, need to have a generic script to identify the queue id of the message being sent. Kindly, help on the same, if using docmd we can create such a command to get the queue id of the submitted email.

I tried getting a response from sendmail itself, but since the mail is eventually sent, there is no return from the command.

Thanks, Dev

来源:https://stackoverflow.com/questions/55998641/using-docmd-to-receive-queue-id-of-a-mail-from-smtp-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!