determine smtp server for a given email address python smtplibCalling a function of a module by using its name (a string)Are static class variables possible in Python?Finding the index of an item given a list containing it in PythonHow can I safely create a nested directory?How do I check if a string is a number (float)?How to determine a Python variable's type?How to print without newline or space?In Python, how do I determine if an object is iterable?Setting different reply-to message in Python email/smtplibWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?

How can I use my cell phone's light as a reading light?

SOQL Query (or other means) to get the icon assigned to an object

Implicit conversion between decimals with different precisions

How to play a D major chord lower than the open E major chord on guitar?

Did William Shakespeare hide things in his writings?

Gory anime with pink haired girl escaping an asylum

Advice for making/keeping shredded chicken moist?

Does the Milky Way orbit around anything?

How to get the speed of my spaceship?

Is there a minimum amount of electricity that can be fed back into the grid?

Are "confidant" and "confident" homophones?

White's last move?

When is one 'Ready' to make Original Contributions to Mathematics?

Machine Learning Golf: Multiplication

Howto display unicode character u2026 in terminal mode in emacs

Possibility to correct pitch from digital versions of records with the hole not centered

What's the big deal about the Nazgûl losing their horses?

How predictable is $RANDOM really?

Chilling juice in copper vessel

Do intermediate subdomains need to exist?

PhD: When to quit and move on?

Why do most airliners have underwing engines, while business jets have rear-mounted engines?

My professor has told me he will be the corresponding author. Will it hurt my future career?

Is this standard Japanese employment negotiations, or am I missing something?



determine smtp server for a given email address python smtplib


Calling a function of a module by using its name (a string)Are static class variables possible in Python?Finding the index of an item given a list containing it in PythonHow can I safely create a nested directory?How do I check if a string is a number (float)?How to determine a Python variable's type?How to print without newline or space?In Python, how do I determine if an object is iterable?Setting different reply-to message in Python email/smtplibWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Given an email address is it possible to determine what the smtp address is using python. I am building an email application using python smtplib.



Thanks










share|improve this question






























    1















    Given an email address is it possible to determine what the smtp address is using python. I am building an email application using python smtplib.



    Thanks










    share|improve this question


























      1












      1








      1








      Given an email address is it possible to determine what the smtp address is using python. I am building an email application using python smtplib.



      Thanks










      share|improve this question
















      Given an email address is it possible to determine what the smtp address is using python. I am building an email application using python smtplib.



      Thanks







      python dns smtp smtplib mx-record






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 9:03









      Florian Weimer

      19k3 gold badges12 silver badges49 bronze badges




      19k3 gold badges12 silver badges49 bronze badges










      asked Mar 25 at 20:26









      the_big_blackboxthe_big_blackbox

      3537 silver badges21 bronze badges




      3537 silver badges21 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          1














          The Python smtplib module does not perform mail routing, so it leaves that to a smart host.



          You could use dnspython to look up MX records for the destination domain (and A and AAAA records if there is no MX record). The resulting address you can then pass to smtplib.



          However, this is only a small fraction of the work that is needed to implement proper mail routing: If the target mail server is unreachable or times out, you are supposed to try the next server. Similarly if it responds with a 4xx error code. If all servers are unavailable, you need to temporarily store the message locally, so you need to implement your own mail queue. Furthermore, your external IP address may be blacklisted for mail delivery.



          Therefore, it is usually easier to install a local mail server such as Exim or Postfix and use that to inject mail, possibly routing it via a smart host with good email reputation to avoid blacklisting.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345895%2fdetermine-smtp-server-for-a-given-email-address-python-smtplib%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            The Python smtplib module does not perform mail routing, so it leaves that to a smart host.



            You could use dnspython to look up MX records for the destination domain (and A and AAAA records if there is no MX record). The resulting address you can then pass to smtplib.



            However, this is only a small fraction of the work that is needed to implement proper mail routing: If the target mail server is unreachable or times out, you are supposed to try the next server. Similarly if it responds with a 4xx error code. If all servers are unavailable, you need to temporarily store the message locally, so you need to implement your own mail queue. Furthermore, your external IP address may be blacklisted for mail delivery.



            Therefore, it is usually easier to install a local mail server such as Exim or Postfix and use that to inject mail, possibly routing it via a smart host with good email reputation to avoid blacklisting.






            share|improve this answer



























              1














              The Python smtplib module does not perform mail routing, so it leaves that to a smart host.



              You could use dnspython to look up MX records for the destination domain (and A and AAAA records if there is no MX record). The resulting address you can then pass to smtplib.



              However, this is only a small fraction of the work that is needed to implement proper mail routing: If the target mail server is unreachable or times out, you are supposed to try the next server. Similarly if it responds with a 4xx error code. If all servers are unavailable, you need to temporarily store the message locally, so you need to implement your own mail queue. Furthermore, your external IP address may be blacklisted for mail delivery.



              Therefore, it is usually easier to install a local mail server such as Exim or Postfix and use that to inject mail, possibly routing it via a smart host with good email reputation to avoid blacklisting.






              share|improve this answer

























                1












                1








                1







                The Python smtplib module does not perform mail routing, so it leaves that to a smart host.



                You could use dnspython to look up MX records for the destination domain (and A and AAAA records if there is no MX record). The resulting address you can then pass to smtplib.



                However, this is only a small fraction of the work that is needed to implement proper mail routing: If the target mail server is unreachable or times out, you are supposed to try the next server. Similarly if it responds with a 4xx error code. If all servers are unavailable, you need to temporarily store the message locally, so you need to implement your own mail queue. Furthermore, your external IP address may be blacklisted for mail delivery.



                Therefore, it is usually easier to install a local mail server such as Exim or Postfix and use that to inject mail, possibly routing it via a smart host with good email reputation to avoid blacklisting.






                share|improve this answer













                The Python smtplib module does not perform mail routing, so it leaves that to a smart host.



                You could use dnspython to look up MX records for the destination domain (and A and AAAA records if there is no MX record). The resulting address you can then pass to smtplib.



                However, this is only a small fraction of the work that is needed to implement proper mail routing: If the target mail server is unreachable or times out, you are supposed to try the next server. Similarly if it responds with a 4xx error code. If all servers are unavailable, you need to temporarily store the message locally, so you need to implement your own mail queue. Furthermore, your external IP address may be blacklisted for mail delivery.



                Therefore, it is usually easier to install a local mail server such as Exim or Postfix and use that to inject mail, possibly routing it via a smart host with good email reputation to avoid blacklisting.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 26 at 9:07









                Florian WeimerFlorian Weimer

                19k3 gold badges12 silver badges49 bronze badges




                19k3 gold badges12 silver badges49 bronze badges


















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55345895%2fdetermine-smtp-server-for-a-given-email-address-python-smtplib%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현