Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9132341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:17:47+00:00 2026-06-17T08:17:47+00:00

I am trying to send an email using python but despite I am using

  • 0

I am trying to send an email using python but despite I am using the local SMTP server it seems that it needs authentication. The code I run and the error I get can be seen below. I use port 587, because port 25 cannot be opened on my server. Could you please help me on setting up the local SMTP server using python on port 587?

>>> import smtplib
>>> from email.mime.text import MIMEText
>>> msg = MIMEText('Test body')
>>> me = 'support@mywebsite.com'
>>> to = 'myemail@gmail.com'
>>> msg['Subject'] = 'My Subject'
>>> msg['From'] = me
>>> msg['To'] = to
>>> s = smtplib.SMTP('localhost', 587)
>>> s.sendmail(me, [to], msg.as_string())

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/smtplib.py", line 722, in sendmail
    raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (530, '5.7.0 Authentication required', 'support@mywebsite.com')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:17:48+00:00Added an answer on June 17, 2026 at 8:17 am

    Then before you attempt to use s.sendmail, you use s.login('user', 'password') – http://docs.python.org/2/library/smtplib.html#smtplib.SMTP.login

    If you don’t have login details – then consult your system admin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send email using smtp authentication through google but I am
I am trying to send email using Kinghost SMTP but I have the following
I'm trying to send and save the send email using C# code. But i
I am trying to send Email using telnet and smtp.mail.yahoo.com server. when I try
I'm trying to send an email using the GMail SMTP server. I have the
I am trying to send an email (through gmail) using python script that someone
I am trying to send email (Gmail) using python, but I am getting following
I'm trying to send an email using gmail SMTP in C# using the code
I am trying to send email using AJAX and PHP but no success:( My
I am trying to send email using c# following is my code. try {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.