Connecting to smtp.gmail.com via command line

后端 未结 10 2363
粉色の甜心
粉色の甜心 2020-12-07 16:42

I am in the process of writing an application that sends mail via an valid GMail user ID and password.

I just wanted to simulate the SMTP connection on my Windows XP

相关标签:
10条回答
  • 2020-12-07 17:19

    tcp/465 was initially intended for establishing the SSL(and newer TLS) layer first, and inside doing cleartext or plain old protocols (smtp here)

    tcp/587 was intended as a replacement to default tcp/25 port initially when spammers and mass mailing attacks commenced like a decade or more ago, but also during those infamous AOL ages, when some funny ISP had some blocks on default ports outbound (such as that tcp/25) for denying their own customers (AOL) to mass-send emails/spam back then, but AOL-customers needing to use alternative mail-accounts and mail-providers still needed to send their mails from AOL-internet connections, so they could still connect to tcp/587 and do simple smtp on it back then.

    The deal with the STARTTLS way to do smtp is to use the two well known originally plain-text tcp/25 and tcp/587 ports, and only when the initial clear-text connect suceeded, to then START the TLS layer (thus STARTTLS) from there on, having a secured connection from that point onwards.

    As for debugging these kind of things maybe via command-line tools, for example for windows there is the historical blat command line mailer (smtp), which up till today cant do TLS (STARTTLS) so it can only use plain-text smtp to send its mails.

    http://www.blat.net/

    Then there are numerous projects freeware and open source software that have more capabilities and features, such as

    smtp client: mailsend @ googlecode http://code.google.com/p/mailsend/

    smtp client: msmtp @ sourceforge (related to mpop below) http://msmtp.sourceforge.net/

    pop3 client: mpop @ sourceforge http://mpop.sourceforge.net/

    0 讨论(0)
  • 2020-12-07 17:22

    Try this:

    telnet smtp.gmail.com 587
    
    0 讨论(0)
  • 2020-12-07 17:25

    For OSX' terminal:

    openssl s_client -connect smtp.gmail.com:25 -starttls smtp 
    
    0 讨论(0)
  • 2020-12-07 17:25

    Jadaaih, you can connect send SMTP through CURL - link to Curl Developer Community.

    This is Curl Email Client source.

    0 讨论(0)
提交回复
热议问题