0

Im trying to write an applescript that sends emails without the mail app. I googled a lot and found two links.

First link: http://www.hamsoftengineering.com/codeSharing/pythonEmail/pythonEmail.html

When I implement this in my code and run it I always get this error:

error "Traceback (most recent call last):
File \"/Users/Kian/Desktop/pythonEmail.py\", line 58, in <module>
server.login(username, passwd)
File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py\", line 622, in login
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, 'Authentication credentials invalid')" number 1

The second link: Use Applescript to send mail without mail.app

When I implement this in my code I always get the followig error from my compiler:

Syntax Error
The run handler is specified more than once, or there were top-level commands in addition to the run handler.

What should I do? Does someone know where the problem is? Im new to applescript and dont understand the errormessage and cant find the problem. Is it possible find the problem and to correct it? Or does someone have a Code that wokrks?

Thanks

Community
  • 1
  • 1
Momo Saibak
  • 37
  • 1
  • 9
  • Sounds like you might just have the wrong SMTP login/password specified in your Python script. – mipadi Sep 27 '16 at 19:09
  • In the first or second code? But im pretty sure that i configured everything correctly! :/ – Momo Saibak Sep 27 '16 at 19:11
  • Uh, the first implementation? The error in your Python script output indicates that you SMTP authentication settings are _not_ correct. – mipadi Sep 27 '16 at 19:17
  • I tried it with another email address but i always get the same error: error "Traceback (most recent call last): File \"/Users/Kian/Desktop/pythonEmail.py\", line 58, in server.login(username, passwd) File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py\", line 622, in login raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (530, 'Must issue a STARTTLS command first')" number 1 Why? :/ – Momo Saibak Sep 27 '16 at 19:33
  • "Must issue a STARTTLS command first" means that the server requires you to use encryption, but the Python script doesn't implement this. – Barmar Sep 27 '16 at 20:53

0 Answers0