Maitiro ekutumira tsamba kubva kumagumo uchishandisa script

Ne X kana Y zvikonzero, dzimwe nguva tinofanirwa kuronga sevha yekambani yedu kuti tiite rimwe basa, uye tinoda kuziva kana iri basa rakaitwa pasina matambudziko, pane izvi isu tinoronga kuti kana zvese zvikafamba zvakanaka, tizivise… The Sevha ingatizivisa sei?

Zvakareruka kwazvo, isu tinokuudza iwe kuburikidza nescript Python Titumire email, nenzira iyi kana tichitarisa bhokisi retsamba, isu tichaverenga kana sevha yanga isina matambudziko ekuisa odha.

Iwo script akavasiya pano: send-email.py

Kuti uishandise iri nyore kwazvo, vhura terminal, mairi nyora zvinotevera uye pinda [Pinda]:

cd $HOME/ && wget http://paste.desdelinux.net/paste/?dl=89 && mv index.html\?dl\=89 send-email.py && chmod +s send-email.py

Ini ndinokusiya kuti maitiro acho angave sei:

% CODE1%

 

Kana izvi zvangoitwa, iwe unofanirwa kugadzirisa script kuti uise yako data, ini ndichaigadzirisa nekuisa data rangu, ndiko kuti, iro data kubva pano basa rangu.

Vhura iyo script (send-email.py) uye chinja iyi data:

  • your-email@desdelinux.net neemail yako (mune uyu muenzaniso - » kzkggaara@ipichcb.rimed.cu)
  • Mutumbi wemeseji nezvakanyorwa muemail (mune uyu muenzaniso - » Iyi email yekuyedza)
  • ns.netsons.cu ne mail yako server (mune ino muenzaniso - » 192.168.1.2)
  • yako email nemushandisi wako (mune uyu muenzaniso - » kzkggaara)
  • yako-password ye password yako (mune uyu muenzaniso - » HAHA… hongu… chokwadi… LOL)

Inotaridzika seinotevera: send-email.py (Modified)

Uye voila, zvinongoramba zvichitumira iyo email ... yeizvi isu tichaisa zvinotevera:

  • python send-email.py "Pano tinoisa musoro wenyaya" receiver@domain.com

Ndokunge, isu tinofanirwa kuita script uye kupasa paramende "Musoro" (ndokuti, iyo nyaya ichatorwa neemail) uyezve kune (email kero) ichatumirwa.

Ini ndichazvitumira email, heino muenzaniso:

% CODE2%

 

Uye zvino 😀

Sezvauri kuona, chimwe chinhu chiri nyore ... asi chinogona kutibatsira pane dzimwe nguva 😉

Reply with quote


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Makomendi gumi, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira iyo data: Miguel Ángel Gatón
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   jondalek akadaro

    zvakanaka kwazvo .. asi ini ndoda chimwe chinhu chakadai chinoshanda chemahwindo asi handichachiwana 🙁

    1.    KZKG ^ Gaara akadaro

      ZveWindows ... mmm ... iwe unofanirwa kuisa Python paWindows shamwari: http://www.python.org/getit/windows/

    2.    John akadaro

      yemahwindo pane chishandiso chinonzi Cobian, yakanaka kwazvo uye inonzwisisika

  2.   Carlos T. akadaro

    nzira yekugonesa sei script kutumira ne gmail (smtp)?

    1.    elwuilmer akadaro

      Ndine mubvunzo mumwe chete: /

      Ndaigona:

      s = SMTP ('smtp.gmail.com')
      s.starttls () # Kana iwe ukashandisa TLS
      e.ehlo ()

      Zvisinei zvinondipa iko kukanganisa:

      python send-email.py "Pano tinoisa musoro wenyaya" aquimi@correo.com
      Traceback (yazvino kufona yekupedzisira):
      Faira "send-email.py", mutsara 14, mu
      s = SMTP ('smtp.gmail.com')
      Faira "/usr/lib/python2.6/smtplib.py", mutsetse 239, mu __init__
      (kodhi, msg) = self.connect (inomiririra, chiteshi)
      Faira "/usr/lib/python2.6/smtplib.py", mutsara 295, mukubatanidza
      self.sock = kuzvimiririra._get_socket (inomiririra, chiteshi, nguva yekuzvimirira)
      Faira "/usr/lib/python2.6/smtplib.py", mutsara 273, mu _get_socket
      return socket.create_connection ((port, host), timeout)
      Faira "/usr/lib/python2.6/socket.py", mutsetse 561, mu create_connection
      simudza kukanganisa, msg
      socket.error: [Errno 101] Mambure acho haasvikike

  3.   reedyseth akadaro

    Zvakanaka, uye wozozvimisikidza nekron uye wakagadzirira kupa mishumo: D.

    1.    KZKG ^ Gaara akadaro

      Ehe! hehe, chengetedza yakawanda nguva inogadzirisa zvinhu nemaquis 🙂

  4.   Luweeds akadaro

    Kutenda nekutumira, ndinoiona ichinakidza uye ichiwedzera mashandiro ayo anonzi Reedyseth ane chimwe chinhu chinoshanda. 😉 kwaziso compas!

    1.    KZKG ^ Gaara akadaro

      Ndinokutendai nemhinduro 😀
      Kwaziwai shamwari.

  5.   Neo61 akadaro

    Gaara, shamwari yangu, ndine chokwadi chekuti chinyorwa ichi chakanakisa sezvo munhu wese pano achisimbisa asi ini - HAPANA-PUE-DO-SE-LOS-E-JEM-PLOS-POR-MI-MAL-DI-TA-CO-NEC - TIONI
    NDINOITA SEI KUTI NDIVAONE, NDICHEDZA ZUVA RANGU?

    1.    KZKG ^ Gaara akadaro

      Haugone kuvhura iyi link? - » http://paste.desdelinux.net/89

  6.   Neo61 akadaro

    Rega ndikubvunze chimwe chinhu, ndingaite script here kuti pane rimwe zuva ndinogona kutumira chaiyo meseji kune vese vashandisi vepakati pedu? Ini ndinofungidzira kudaro, asi iwe ndiwe nyanzvi uye kana ukasimbisa izvi, unogona kundibatsira kugadzira imwe here?

    1.    KZKG ^ Gaara akadaro

      Ehe, kuita "chimwe chinhu" pazuva rakapihwa iwe unofanirwa kushandisa crontab.
      Zvino, uchifunga kuti iwe unoda kutumira iyo .PDF faira (semuenzaniso, noti.pdf) kune vashandisi vako, kutumira kune chete email imwe ichave iri:
      mail -s "Este es el asunto del correo" direccionemail@loquesea.cu < nota.pdf

      Zvino, kutumira izvo asi kwete chete kune imwe kero, asi kune akawanda akawanda ... iwe unozofanirwa kuve nemakero mune runyorwa faira (rakaparadzaniswa netambo tsemura), wozoshandisa chiuno nokuti. Semuenzaniso, kana iwe uine maemail mumakero.txt, ichave iri:

      for i in `cat direcciones.txt`;
      do
      mail -s "Este es el asunto del correo" $i < nota.pdf
      done

  7.   David kenduru akadaro

    Thanks shamwari, script inoshanda zvakanaka.

  8.   va pachena akadaro

    Iripi script kana iwe uchikwanisa kundibatsira

  9.   areli akadaro

    Unogona here kugovana iyi mienzaniso?

bool (chokwadi)