send email using telnet

来源:互联网 发布:linux升级网卡驱动 编辑:程序博客网 时间:2024/06/11 17:28
  1. Open your command prompt.
  2. Now, connect with telnet using the following command:
    telnet example.com 25
  3. Type ehlo example.com. Some servers also accept helo in place of ehlo.
    ehlo example.com
  4. Type mail from: username@example.com:
    mail from: username@example.com
  5. Type rcpt to: friend@hotmail.com, friend2@yahoo.com (replace with your actual recipient name):
    rcpt to: friend@hotmail.com, friend2@yahoo.com
  6. To write the message - type data, followed by your subject and message. To end the message, put a period on a line by itself and press enter:
    dataSubject: My Telnet Test EmailHello,This is an email sent by using the telnet command.Your friend,Me.
  7. Type quit to exit telnet.
Sample:
[c:\~]$ telnet 138.35.54.172 25




Connecting to 138.35.54.172:25...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.


220 smtpx.svcs.hpe.com ESMTP Postfix
500 5.5.2 Error: bad syntax


500 5.5.2 Error: bad syntax
ehlo 138.35.54.172
250-smtpx.svcs.hpe.com
250-PIPELINING
250-SIZE 31457280
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: xia@hpe.com
250 2.1.0 Ok
rcpt to: xia@hpe.com
250 2.1.5 Ok
data
502 5.5.2 Error: command not recognized
data
354 End data with <CR><LF>.<CR><LF>
Subject: Test mail
Hellow ord!!!


.
250 2.0.0 Ok: queued as E634075E02CA

原创粉丝点击