0 votes

Hello,

I am using the py smtp template which is provided. I just modifed the username and subject, but the mail is not delivering to "efail.rub@mail.de". Could you let me know if I misunderstood any instructions? Below is the modification done to the template (in bolds) and the mail response.

login = "mahesh"

message = """

Subject: TEST https://eo8owroa5l53net.m.pipedream.net

<rest of the content>

"""

Mail err: Mailerr.jpg

by
edit history
0
I found a workaround for the template. Instead of using Upb mail, use Gmail instead.
Create app password (https://support.google.com/accounts/answer/185833?hl=en#zippy=%2Cremove-app-passwords).
Check the "SMTP_SSL Example" on
https://stackoverflow.com/questions/10147455/how-to-send-an-email-with-gmail-as-provider-using-python
0
Same for me, I don't get any reply.

2 Answers

0 votes
Best answer

Update to this question, the following works using gmail. Create Gmail app password (https://support.google.com/accounts/answer/185833?hl=en#zippy=%2Cremove-app-passwords).

import smtplib
 
password = "" # App password for your gmail account
 
# your gmail email address
sender = ""
 
# No changes here
receiver = "efail.rub@mail.de"
 
message = """From: sender.efail.upb@mail.de
To: efail.rub@mail.de
Subject: TEST https://zzz.net
Date: Fri, 10 Jul 2020 18:00:00 +0100
MIME-Version: 1.0
Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m
<rest of S/MIME message here>
"""
 
try:
    smtpObj = smtplib.SMTP_SSL("smtp.gmail.com", 465)
    smtpObj.ehlo()
    smtpObj.login(sender, password)
    smtpObj.sendmail(sender, receiver, message)
    print("Successfully sent email")
    smtpObj.close()
except smtplib.SMTPException as e:
    print("Error: unable to send email", e)
by
edit history
0 votes

Same for me.
I also tried with subject: TEST [https://....ngrok-free.dev]
and also with http instead of https.

Edit: I got a message from the mail server:

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

  efail.rub@mail.de

    host mx02.mail.de [2001:868:100:600::211]

    SMTP error from remote mail server after end of data:

    550 5.7.1 REJECT - Policy Violation; DMARC-Policy quarantine triggered

by
edit history
0
Finally i got it working by changing 'sender.efail.upb@mail.de' to my own @mail.uni-paderborn.de mail. So it does work with the upb mailer