<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div><br>This is the only message that I will send to this list regarding my question:<br><br>1. I have copied and paste my code from Eclipe PyDev and I have used web interface for yahoo email to send the email. I don't know why the message arrived like that. I consider that the message from Dave was rude and just a replay considering the structure of the script would have been enough<br>2. Regarding the useless of the question: I consider that you two are also rude! There are some many more "useless" questions than my question on this forum!<br><br>Do not bother to replay to this email because I would not receive the message. Your  replays were enough to make me unsubscribe from the list<br><br>I.S.<br><br><br></div><div style="font-family: times new roman,new york,times,serif; font-size:
 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Thomas Jollans <thomas@jollybox.de><br><b><span style="font-weight: bold;">To:</span></b> python-list@python.org<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, August 31, 2010 4:46:58 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: sendmail error<br></font><br>
On Tuesday 31 August 2010, it occurred to sandric ionut to exclaim:<br>> Hello:<br>> <br>> I have a script for sending email from python (it is attached bellow). When<br>> I am launching the script I get the error:<br>> TypeError: cannot concatenate 'str' and 'type' objects if I use<br>> sys.argv[1], but if I input from the begging an email address like<br>> "<a ymailto="mailto:email@email.com" href="mailto:email@email.com">email@email.com</a>", the script is working OK<br>> <br>> What could be the problem?<br>> <br>> Thank you,<br>> <br>> Ionut<br>> <br>> import<br>> mesaj = email.MIMEMultipart.MIMEMultipart()<br>> fromEmail = sys.argv[<br>> toEmail = os, sys, smtplib, email1]"toEmail"mesaj[<br>> mesaj[<br>> mesaj["From"] = fromEmail"To"] = toEmail"Subject"] = "Teste"mesaj[<br>> atasament = r"Date"] =<br>> email.Utils.formatdate(localtime=True)"d:\Doc1.zip"atasamentP =<br>>
 email.MIMEBase.MIMEBase(<br>> atasamentP.set_payload(open(atasament,<br>> email.Encoders.encode_base64(atasamentP)<br>> atasamentP.add_header(<br>> mesaj.attach(atasamentP)<br>> mesaj.attach(email.MIMEText.MIMEText(<br>> smtpObj =<br>> smtplib.SMTP('application','zip')"rb").read())'Content-Disposition','attach<br>> ement; filename="%s"'% os.path.basename(atasament))"Email transmis la data:<br>> ", email.Utils.formatdate(localtime=False)))"192.168.1.2")try<br>> smtpObj.sendmail(fromEmail, toEmail, mesaj.as_string())<br>> smtpObj.close():exceptsmtplib.SMTPException:print"eroare: "+<br>> smtplib.SMTPException<br><br>I struggle to imagine what one might do to a piece of code to garble it this <br>badly. If this was actually the script you're trying to run, then it would <br>have blown up in your face with a angry SyntaxError, not the helpful TypeError <br>you quoted. As far as I can see, you never actually use
 sys.argv[1], so this <br>can't be the right code.<br><br>To paraphrase what you failed to spell correctly in your other message, please <br>don't bother sending useless inquiries to this list. If you want to get a <br>useful reply, please:<br><br> - Quote the code correctly. Before sending, check that it actually makes<br>   sense. The above is quite simply nothing like Python.<br><br> - Quote the entire stack trace and error message. You might have looked at it<br>   already, but we haven't. This information is not useless!<br><br>Also, when replying:<br><br>  - Quote properly. While top posting is discouraged, the most important bit<br>    is to clearly distinguish quoted material from new material. Make it<br>    possible from the structure of the message you're sending which parts you<br>    wrote and which parts you're just quoting.<br><br>  - Keep your reply on-list.<br><br> - Thomas<br><br>--
 <br><span><a target="_blank" href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a></span><br></div></div>
</div><br>

      </body></html>