Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The most likely explanation for only receiving a subset of the messages that you're sending is that the destination is discarding them (have you checked a spam folder?). FWIW, if I use your script, all 100 messages arrive.</p> <p>When you send the message, you might get rejected by Google, or they might accept it for delivery. When Google attempts to deliver the message, it might get rejected (in which case you should get a delivery status notice from Google) or it might get accepted. Some mail servers may say that they accept the message, but not deliver it (possibly discarding it, or routing it into some sort of quarantine).</p> <p>So that leaves us back at the original problem: why can't you send your 200 character message? Let's see what happens when we try to send just that message:</p> <pre><code>&gt;&gt;&gt; import smtplib &gt;&gt;&gt; s = smtplib.SMTP("smtp.gmail.com", 587) &gt;&gt;&gt; s.ehlo() (250, 'mx.google.com at your service, [60.234.179.13]\nSIZE 35882577\n8BITMIME\nSTARTTLS\nENHANCEDSTATUSCODES') &gt;&gt;&gt; s.starttls() (220, '2.0.0 Ready to start TLS') &gt;&gt;&gt; s.ehlo() (250, 'mx.google.com at your service, [60.234.179.13]\nSIZE 35882577\n8BITMIME\nAUTH LOGIN PLAIN XOAUTH\nENHANCEDSTATUSCODES') &gt;&gt;&gt; s.login("username", "password") (235, '2.7.0 Accepted') &gt;&gt;&gt; s.mail("sender") (250, '2.1.0 OK n2sm1693666ybe.6') &gt;&gt;&gt; s.rcpt("recipient") (250, '2.1.5 OK n2sm1693666ybe.6') &gt;&gt;&gt; s.data("Subject: " + ("a" * 200) + "\n\nThis is a test message.") (250, '2.0.0 OK 1316147451 n2sm1693666ybe.6') &gt;&gt;&gt; s.quit() (221, '2.0.0 closing connection n2sm1693666ybe.6') </code></pre> <p>This was accepted (so the issue isn't there), and it also arrives (some headers snipped):</p> <pre><code>Received: by 10.223.158.77 with SMTP id e13cs10409fax; Thu, 15 Sep 2011 21:30:54 -0700 (PDT) Received: by 10.100.214.1 with SMTP id m1mr1823145ang.134.1316147453266; Thu, 15 Sep 2011 21:30:53 -0700 (PDT) Received: from mail-gx0-f178.google.com (mail-gx0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id l19si1913755anm.182.2011.09.15.21.30.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Sep 2011 21:30:52 -0700 (PDT) Received: by mail-gx0-f178.google.com with SMTP id 21so2167851gxk.23 for &lt;tony.meyer@gmail.com&gt;; Thu, 15 Sep 2011 21:30:51 -0700 (PDT) Received: by 10.151.43.6 with SMTP id v6mr2088425ybj.402.1316147451688; Thu, 15 Sep 2011 21:30:51 -0700 (PDT) Received: from somewhere ([60.234.179.13]) by mx.google.com with ESMTPS id n2sm1693666ybe.6.2011.09.15.21.30.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Sep 2011 21:30:51 -0700 (PDT) Message-ID: &lt;4e72d0fb.02a5960a.3f71.60b1@mx.google.com&gt; Date: Thu, 15 Sep 2011 21:30:51 -0700 (PDT) Sender: Tony Meyer &lt;address&gt; From: someone Subject: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa This is a test message. </code></pre> <p>So potentially your code can work, and the message will arrive: the issue is with the destination of your email message. Unfortunately, if they are silently discarding the message, then it's difficult to know <strong>why</strong> they are doing that (as opposed to getting a DSN that will have a reason).</p> <p>Your code includes a section for including an attachment - is this included when the sending fails? It may be the cause of the problem. RFC 5322 states that lines <strong>should</strong> be a maximum of 78 characters long (although they <strong>may</strong> be up to 998) - perhaps the destination is enforcing the stricter value? (Assuming your 200 characters are on a single line). If so, then you can encode (e.g. quoted-printable or base64) the body or use continuations to wrap a subject.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload